org.apache.uima.annotator.dict_annot.dictionary.impl
Class DictionaryMatchImpl

java.lang.Object
  extended by org.apache.uima.annotator.dict_annot.dictionary.impl.DictionaryMatchImpl
All Implemented Interfaces:
DictionaryMatch

public class DictionaryMatchImpl
extends java.lang.Object
implements DictionaryMatch

Implementation of the DictionaryMatch interface. Store the matches found in the dictionary temporarily and check on the fly in they are valid or not. All valid matches are stored separately. The last valid match is replaced if a new valid match was found. At the end the match object contains the longest valid match from the dictionary.


Constructor Summary
DictionaryMatchImpl()
          Creates a new DictionaryMatch object and reset all members
 
Method Summary
 int getMatchLength()
          Returns the length of the match.
 EntryMetaData getMatchMetaData()
          Returns the dictionary match entry meta data.
 boolean isValidMatch()
          check if a valid match is available.
 void reset()
          reset the match data
 void storeMatch(EntryMetaData metaData, boolean isComplete)
          stores a new match in the match object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryMatchImpl

public DictionaryMatchImpl()
Creates a new DictionaryMatch object and reset all members

Method Detail

getMatchMetaData

public EntryMetaData getMatchMetaData()
Description copied from interface: DictionaryMatch
Returns the dictionary match entry meta data.

Specified by:
getMatchMetaData in interface DictionaryMatch
Returns:
The dictionary match entry meta data is returned

getMatchLength

public int getMatchLength()
Description copied from interface: DictionaryMatch
Returns the length of the match.

Specified by:
getMatchLength in interface DictionaryMatch
Returns:
returns 1 for a single word match. In case of a multi word match, the multi word token count is returned.

storeMatch

public void storeMatch(EntryMetaData metaData,
                       boolean isComplete)
stores a new match in the match object

Parameters:
metaData - metaData for the entry that matched
isComplete - specifies if the entry is a temporary match or a valid match

isValidMatch

public boolean isValidMatch()
check if a valid match is available.

Returns:
returns true if a valid match is available, otherwise false is returned

reset

public void reset()
reset the match data



Copyright © 2011. All Rights Reserved.