Namespace: Nlp4Net.NlpLib Assembly: NlpLib.dll
Word provides part of speech and optional syntax information about a
Lexeme. Syntax parser relies on this information
to find syntax relations between words in an utterance.
If word is a fragment of a compound lexeme like "hot dog" or "cannot", it
contains information allowing to construct the whole compound from fragments.
You can associate your objects with a Word, using
IUserData interface. IUserData.UserData can be
a primary key in your dictionary, sound file or semantic information.
Typically you use Word.Text, Word.POS and Word.Tags properties.
Note: synchronizing Words with your dictionaries.
If you want to associate a word with your database, you can use Word.LCID +
Word.Text + Word.POS + Word.Tags as a primary key.
It is the independent [lexical + syntax] key identifying a word in any dictionary.
For better performance you can use a short key: [NlpLib file version] +
Word.LCID + Word.Id to build a fast index of words used in your application.
Word.Id is not guaranteed to be the same if the build number of NlpLib.dll is
changed. If you replace NlpLib.dll with a different file version, you need to
rebuild the index.
To synchronize with your dictionary you can enumerate words
from your dictionary and parse them using NLParser.Text<Lexeme>(string szMyWord)
| Constructors |
Description |
Word() |
creates an empty Word |
Word(Word other) |
copy constructor |
Word(string text) |
initializes Word with a string |
Word(int LCID, string text) |
initializes Word with LCID and a string |