Class: Word

.models. Word

A class representing a Word token

new Word( [data])

Create a new Word
Parameters:
Name Type Argument Description
data Object <optional>
The raw data for this word token
Properties
Name Type Argument Description
gloss Object <optional>
The gloss for this word, in MultiLangString format.
key String <optional>
The uniquely identifying key for this word token, as a string. The key for a phrase consists of the abbreviation of the text, a period, the number of phrase within the text, another period, and then the number of this word within the phrase (indexing starts at 1). For example, for the fourth word of the third phrase of a text with the abbreviation `A`, the key would be `A.3.4`. Keys should be unique within a corpus.
morphemes Array An array of the morphemes or components in this word token. Each morpheme must be formatted as a Morpheme. May be an empty array.
notes Array <optional>
An array of notes about this word token. Each note must be in the Note format.
transcription Object The transcriptions for this word token, optionally in multiple orthographies, formatted as a MultiLangString.
translation Object <optional>
The translations for this word token, optionally in multiple orthographies, formatted as a MultiLangString. Note that the translation is not the same as a gloss. Use the translation field for free, natural language translations of a word; use the gloss field for Leipzig-style glosses only.
url String <optional>
The URL where this word token can be accessed. Must be a valid URI.
Properties:
Name Type Description
gloss Object The Leipzig gloss for this word, as a MultiLangString.
key String The uniquely identifying key for this word token
morphemes Array An array of the morphemes or components in this word token. Each item is a Morpheme.
notes Array An array of notes about this word token. Each item is a Note object.
transcription Object The transcriptions of this word token, optionally in multiple orthographies, as a MultiLangString.
txn String A shorthand for accessing the default orthography of the `transcription` object, if one is set
translation Object The translations of this word token, optionally in multiple orthographies, as a MultiLangString. Note that the translation is not the same as a gloss. Use the translation field for free, natural language translations of a word; use the gloss field for Leipzig-style glosses only.
tln String A shorthand for accessing the default orthography of the `translation` object, if one is set
url String The URL where this word token can be accessed.
Example
const word = new Word({

  transcription: {
    spa: 'hablo',
    ipa: 'ablo',
  },

  translation: {
    eng: 'I speak',
  },

  morphemes: [
    { lexeme: 'habl' },
    { lexeme: 'o' },
  ],

});

console.log(word.transcription.spa); // 'hablo'