new LexemeReference( [data])
Create a new Lexeme Reference.
Parameters:
Name |
Type |
Argument |
Description |
data |
Object
|
String
|
<optional>
|
The data to use for the Lexeme Reference. If the data is a string, that string will become the "lexeme" property, indicating the key of the referenced lexeme. Otherwise an object must be passed containing a "lexeme" property.
Properties
Name |
Type |
Argument |
Description |
lexeme |
String
|
|
The key (abbreviation) of the lexeme being referenced |
lexemeUrl |
String
|
<optional>
|
The URL of the referenced lexeme. Must be a valid URI. |
lexicon |
String
|
<optional>
|
The key (abbreviation) of the lexicon being referenced |
relation |
String
|
<optional>
|
A string indicating the type of relationship between the current item and the referenced lexeme. This property is required when the reference is being used in the "lexicalRelations" property of the Lexeme. |
sense |
Integer
|
<optional>
|
The number of the sense being reference (i.e. its index in the senses array). Note that the senses array is zero-indexed. |
variantType |
Object
|
<optional>
|
The type of variant that the referenced lexeme is. Must be formatted as a MultiLangString. |
|
Properties:
Name |
Type |
Description |
lexeme |
String
|
The key (abbreviation) of the lexeme being referenced |
lexemeUrl |
String
|
The URL of the referenced lexeme. Must be a valid URI. |
lexicon |
String
|
The key (abbreviation) of the lexicon being referenced |
lexiconUrl |
String
|
The URL of the referenced lexicon. Must be a valid URI. |
relation |
String
|
The type of relation that holds between this item and the referenced lexeme |
sense |
Integer
|
The index of the sense being referenced |
variantType |
MultiLangString
|
The type of variant that the referenced lexeme is. A MultiLangString. |
Examples
const ref = new LexemeReference('calle1');
console.log(ref.lexeme); // calle1
const ref = new LexemeReference({
lexeme: 'calle1',
lexicon: 'spanish',
});
console.log(ref.lexeme); // calle1