Class VariableMWEModel

All Implemented Interfaces:

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).

$Revision: 1.1 $, $Date: 2002/03/12 12:51:20 $
Mike Atkinson

Nested Class Summary
static class VariableMWEModel.ModelData
Constructor Summary
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

Constructor Detail


public VariableMWEModel()
Method Detail


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
l - An array of the words to be searched.
pos - The position in the array of the first word of the MWE.
if 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)
Adds a MWE to the model.

Specified by:
addMWE in interface MWEModel
mweWords - The space separated MWE to add to the model.

Copyright © 2003 Jason Baldridge and Gann Bierner. All Rights Reserved.