ReferenceTextPair Class

  • java.lang.Object
    • com.azure.ai.translation.text.models.ReferenceTextPair

Implements

public final class ReferenceTextPair
implements JsonSerializable<ReferenceTextPair>

Reference text pair to generate adaptive customized translation.

Constructor Summary

Constructor Description
ReferenceTextPair(String source, String target)

Creates an instance of ReferenceTextPair class.

Method Summary

Modifier and Type Method and Description
static ReferenceTextPair fromJson(JsonReader jsonReader)

Reads an instance of ReferenceTextPair from the JsonReader.

String getSource()

Get the source property: Source reference sentence.

String getTarget()

Get the target property: Target reference sentence.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

ReferenceTextPair

public ReferenceTextPair(String source, String target)

Creates an instance of ReferenceTextPair class.

Parameters:

source - the source value to set.
target - the target value to set.

Method Details

fromJson

public static ReferenceTextPair fromJson(JsonReader jsonReader)

Reads an instance of ReferenceTextPair from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ReferenceTextPair if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getSource

public String getSource()

Get the source property: Source reference sentence.

Returns:

the source value.

getTarget

public String getTarget()

Get the target property: Target reference sentence.

Returns:

the target value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to