Lexeme

Lexeme class description

Namespace: Nlp4Net.NlpLib Assembly: NlpLib.dll

public class Lexeme : IUserData, ICloneable


Lexeme is a string of characters. There are three types Lexeme.LexType of Lexemes.

Lexemes with syntax and semantic information contain Words.

Note: lexical ambiguity

There may be several syntactically different Words associated with the same Lexeme. For example the same lexeme "code" has two Words: noun and verb; it plays different syntax roles and carries different semantic in the following utterances: "We code the project. The code is complex." Which Word is used can be determined only during higher levels of processing.

Words may belong to different languages. Currently NlpLib supports only en-US language.

You can use lexical ambiguity in OCR or speech recognition when Lexeme is not clearly recognized. Instead of processing different lexemes, overload the same Lexeme with possible Words and let syntax parser to make a choice.




Constructors Description
Nlp4Net method Lexeme() creates an empty Lexeme
Nlp4Net method Lexeme(Lexeme other) copy constructor
Nlp4Net method Lexeme(string text) initializes Lexeme with a string



Methods Description
Nlp4Net method object ICloneable.Clone() creates a copy of Lexeme



Properties Description
Nlp4Net propertybool HasWords true if Lexeme has at least one Word
Nlp4Net propertyint IndexInUtterance index in Utterance.Lexemes array
Nlp4Net propertyLexeme.LexType LexemeType Lexeme can be one of three types. See Lexeme.LexType
Nlp4Net propertylong Position Position in chars in a text stream since last NLParser.Flush()
Nlp4Net propertystring Text string of characters comprising the Lexeme
Nlp4Net propertyobject IUserData.UserData Your arbitrary object
Nlp4Net propertyWord[] Words An array of Words associated with the Lexeme