opennlp.grok.preprocess.mwe
Class VariableMWEModel
java.lang.Object
|
+--opennlp.grok.preprocess.mwe.VariableMWEModel
- All Implemented Interfaces:
- MWEModel
- public class VariableMWEModel
- extends java.lang.Object
- implements MWEModel
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).
- Version:
- $Revision: 1.1 $, $Date: 2002/03/12 12:51:20 $
- Author:
- Mike Atkinson
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VariableMWEModel
public VariableMWEModel()
getMWE
public java.lang.String[] getMWE(java.lang.String[] l,
int pos)
- Finds the MWE (if any) at a position in the sequence of words.
- Specified by:
getMWE
in interface MWEModel
- Parameters:
l
- An array of the words to be searched.pos
- The position in the array of the first word of the MWE.
- Returns:
- if
null
then a MWE has not been found at that position,
else the longest MWE found at that position.
addMWE
public void addMWE(java.lang.String mweWords)
- Adds a MWE to the model.
- Specified by:
addMWE
in interface MWEModel
- Parameters:
mweWords
- The space separated MWE to add to the model.
Copyright © 2003 Jason Baldridge and Gann Bierner. All Rights Reserved.