Word

public struct Word : Codable, Equatable

Information about a word for the custom model.

  • Japanese only. The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see Working with Japanese entries.

    See more

    Declaration

    Swift

    public enum PartOfSpeech : String
  • The word for the custom model. The maximum length of a word is 49 characters.

    Declaration

    Swift

    public var word: String
  • The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for representing the phonetic string of a word either as an IPA or IBM SPR translation. The Arabic, Chinese, Dutch, Australian English, and Korean languages support only IPA. A sounds-like translation consists of one or more words that, when combined, sound like the word. The maximum length of a translation is 499 characters.

    Declaration

    Swift

    public var translation: String
  • Japanese only. The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see Working with Japanese entries.

    Declaration

    Swift

    public var partOfSpeech: String?
  • Initialize a Word with member variables.

    Declaration

    Swift

    public init(
        word: String,
        translation: String,
        partOfSpeech: String? = nil
    )

    Parameters

    word

    The word for the custom model. The maximum length of a word is 49 characters.

    translation

    The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for representing the phonetic string of a word either as an IPA or IBM SPR translation. The Arabic, Chinese, Dutch, Australian English, and Korean languages support only IPA. A sounds-like translation consists of one or more words that, when combined, sound like the word. The maximum length of a translation is 499 characters.

    partOfSpeech

    Japanese only. The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see Working with Japanese entries.

    Return Value

    An initialized Word.