org.cogroo.tools.checker.rules.dictionary
Class TagDictionary

java.lang.Object
  extended by org.cogroo.tools.checker.rules.dictionary.TagDictionary
All Implemented Interfaces:
CogrooTagDictionary

public class TagDictionary
extends Object
implements CogrooTagDictionary

Provides access to the FSA tag dictionary

Author:
William Colen

Constructor Summary
TagDictionary(LexicalDictionary access, boolean caseSensitive, TagInterpreter tagInterpreter)
           
 
Method Summary
 MorphologicalTag convertToTargetConvention(String ori)
           
 boolean exists(String word, boolean cs)
           
 String[] getInflectedPrimitive(String primitive, TagMask tagMask, boolean cs)
          Given a lexeme, returns its inflected form as determined by the tagMask.
 String[] getPrimitive(String lexeme, MorphologicalTag morphologicalTag, boolean cs)
          Given a lexeme and its morphological tag, returns the possible primitives of the lexeme or an array with an empty string, if none is found.
 String[] getPrimitive(String lexeme, TagMask tagMask, boolean cs)
          Given a lexeme and its inflected form as determined by the tagMask, returns its primitive.
 TagInterpreter getTagInterpreter()
           
 MorphologicalTag[] getTags(String word)
          Returns a list of valid tags for the specified word.
 MorphologicalTag[] getTags(String word, boolean cs)
          Returns a list of valid tags for the specified word.
 boolean match(String lexeme, TagMask tagMask, boolean cs)
          Tells if a lexeme inflected as determined by the tagMask, exists in the dictionary.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagDictionary

public TagDictionary(LexicalDictionary access,
                     boolean caseSensitive,
                     TagInterpreter tagInterpreter)
Method Detail

exists

public boolean exists(String word,
                      boolean cs)
Specified by:
exists in interface CogrooTagDictionary

getInflectedPrimitive

public String[] getInflectedPrimitive(String primitive,
                                      TagMask tagMask,
                                      boolean cs)
Description copied from interface: CogrooTagDictionary
Given a lexeme, returns its inflected form as determined by the tagMask. Returns an array with an empty string if the inflection could not be found.

Specified by:
getInflectedPrimitive in interface CogrooTagDictionary
tagMask - the tag mask will determine the inflection
cs - case sensitive?
Returns:
the inflected form of the lexeme

getPrimitive

public String[] getPrimitive(String lexeme,
                             TagMask tagMask,
                             boolean cs)
Description copied from interface: CogrooTagDictionary
Given a lexeme and its inflected form as determined by the tagMask, returns its primitive.

Specified by:
getPrimitive in interface CogrooTagDictionary
Parameters:
lexeme - the lexeme of which the primitive will be searched
tagMask - the mask that represents the inflection of the lexeme
cs - case sensitive?
Returns:
the primitive of the lexeme

getPrimitive

public String[] getPrimitive(String lexeme,
                             MorphologicalTag morphologicalTag,
                             boolean cs)
Description copied from interface: CogrooTagDictionary
Given a lexeme and its morphological tag, returns the possible primitives of the lexeme or an array with an empty string, if none is found.

Specified by:
getPrimitive in interface CogrooTagDictionary
Parameters:
lexeme - a lexeme
morphologicalTag - a morphological tag
cs - tells whether the match of the lexeme must be case sensitive or not
Returns:
the primitives of the lexeme with the associated morphological tag or an array with an empty string as the first element if no primitive is found

match

public boolean match(String lexeme,
                     TagMask tagMask,
                     boolean cs)
Description copied from interface: CogrooTagDictionary
Tells if a lexeme inflected as determined by the tagMask, exists in the dictionary.

Specified by:
match in interface CogrooTagDictionary
Parameters:
lexeme - the lexeme to be searched
tagMask - the inflection of the lexeme
cs - case sensitive?
Returns:
true if the lexeme is found, false otherwise

getTags

public MorphologicalTag[] getTags(String word,
                                  boolean cs)
Description copied from interface: CogrooTagDictionary
Returns a list of valid tags for the specified word.

Specified by:
getTags in interface CogrooTagDictionary
Parameters:
word - The word.
Returns:
A list of valid tags for the specified word or null if no information is available for that word.

getTags

public MorphologicalTag[] getTags(String word)
Description copied from interface: CogrooTagDictionary
Returns a list of valid tags for the specified word.

Specified by:
getTags in interface CogrooTagDictionary
Parameters:
word - The word.
Returns:
A list of valid tags for the specified word or null if no information is available for that word.

convertToTargetConvention

public MorphologicalTag convertToTargetConvention(String ori)

getTagInterpreter

public TagInterpreter getTagInterpreter()
Specified by:
getTagInterpreter in interface CogrooTagDictionary


Copyright © 2012-2013 CoGrOO. All Rights Reserved.