|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--opennlp.grok.preprocess.mwe.FixedMWEModel
A model holding the Fixed Lexicon Multi-Word Expressions.
It uses the first word to index into a Map. As most first words for Fixed Lexicon MWEs are not normal English words they occur very infrequently except as part of the MWE. Therefore this algorithm is very fast only taking a single Hash Map lookup for words which do not start any MWE (the vast majority of words in any normal English text).
| Nested Class Summary | |
static class |
FixedMWEModel.ModelData
|
| Constructor Summary | |
FixedMWEModel()
|
|
| Method Summary | |
void |
addMWE(java.lang.String mweWords)
Adds a MWE to the model. |
java.lang.String[] |
getMWE(java.lang.String[] l,
int pos)
Finds the MWE (if any) at a position in the sequence of words. |
boolean |
isFixedMWE(java.lang.String[] l,
int pos)
Finds if there is a MWE at a position in the sequence of words. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FixedMWEModel()
| Method Detail |
public boolean isFixedMWE(java.lang.String[] l,
int pos)
l - An array of the words to be searched.pos - The position in the array of the first word of the MWE.
true when a MWE has been found at that position.
public java.lang.String[] getMWE(java.lang.String[] l,
int pos)
getMWE in interface MWEModell - An array of the words to be searched.pos - The position in the array of the first word of the MWE.
null then a MWE has not been found at that position,
else the longest MWE found at that position.public void addMWE(java.lang.String mweWords)
addMWE in interface MWEModelmweWords - The space separated MWE to add to the model.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||