com.alibaba.dashscope.audio.asr.recognition.timestamp.Sentence Maven / Gradle / Ivy
// Copyright (c) Alibaba, Inc. and its affiliates.
package com.alibaba.dashscope.audio.asr.recognition.timestamp;
import com.alibaba.dashscope.utils.JsonUtils;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import java.util.List;
import lombok.Data;
@Data
public class Sentence {
@SerializedName("begin_time")
Long beginTime;
/** Sentence end time in milliseconds. */
@SerializedName("end_time")
Long endTime;
String text;
/** Sentence words. */
List words;
public static Sentence from(String message) {
return JsonUtils.fromJson(message, Sentence.class);
}
public static Sentence from(JsonObject json) {
return JsonUtils.fromJsonObject(json, Sentence.class);
}
}