net.sf.extjwnl.dictionary.morph
Class DefaultMorphologicalProcessor

java.lang.Object
  extended by net.sf.extjwnl.dictionary.morph.DefaultMorphologicalProcessor
All Implemented Interfaces:
MorphologicalProcessor

public class DefaultMorphologicalProcessor
extends Object
implements MorphologicalProcessor

Default implementation of MorphologicalProcessor. This isn't a true morphological analyzer (it doesn't figure out all the characteristics of each word it processes). This is basically a stemmer that uses WordNet exception files instead of complex stemming rules. It also tries to be intelligent by removing delimiters and doing concatenation.

Author:
John Didion , Aliaksandr Autayeu

Field Summary
static String CACHE_CAPACITY
          Parameter that determines the size of the base form cache.
static String OPERATIONS
          Parameter that determines the operations this morphological processor will perform.
 
Constructor Summary
DefaultMorphologicalProcessor(Dictionary dictionary, Map<String,Param> params)
           
 
Method Summary
 Dictionary getDictionary()
           
 List<String> lookupAllBaseForms(POS pos, String derivation)
          Return all the base forms of derivation.
 IndexWord lookupBaseForm(POS pos, String derivation)
          Lookup the base form of a word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_CAPACITY

public static final String CACHE_CAPACITY
Parameter that determines the size of the base form cache.

See Also:
Constant Field Values

OPERATIONS

public static final String OPERATIONS
Parameter that determines the operations this morphological processor will perform.

See Also:
Constant Field Values
Constructor Detail

DefaultMorphologicalProcessor

public DefaultMorphologicalProcessor(Dictionary dictionary,
                                     Map<String,Param> params)
                              throws JWNLException
Throws:
JWNLException
Method Detail

lookupBaseForm

public IndexWord lookupBaseForm(POS pos,
                                String derivation)
                         throws JWNLException
Lookup the base form of a word. Given a lemma, finds the WordNet entry most like that lemma. This function returns the first base form found. Subsequent calls to this function with the same part-of-speech and word will return the same base form. To find another base form for the pos/word, call lookupNextBaseForm.

Specified by:
lookupBaseForm in interface MorphologicalProcessor
Parameters:
pos - the part-of-speech of the word to look up
derivation - the word to look up
Returns:
IndexWord the IndexWord found during lookup
Throws:
JWNLException - JWNLException

lookupAllBaseForms

public List<String> lookupAllBaseForms(POS pos,
                                       String derivation)
                                throws JWNLException
Description copied from interface: MorphologicalProcessor
Return all the base forms of derivation.

Specified by:
lookupAllBaseForms in interface MorphologicalProcessor
Parameters:
pos - part of speech
derivation - derivation
Returns:
all the base forms of derivation
Throws:
JWNLException - JWNLException

getDictionary

public Dictionary getDictionary()


Copyright © 2011. All Rights Reserved.