All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----COM.Lexical.Metaphrase.SemanticClassifier
|
+----COM.Lexical.Metaphrase.StandardClassifier
User specifies a list of SemanticClasses (highest precedence first) and a Perl5 regular expression for each one except the last (the "default"). classify(Concept concept) runs through the list of SemanticClasses, and returns the first SemanticClass for which the corresponding pattern matches types+"/"+concept.atoms()[0].origin(), where types is the "|"- delimited list of the STN's of each of concept.semanticTypes(), or returns the default SemanticClass if none of the patterns match.
public StandardClassifier(SemanticClass semanticClasses[],
java.lang.String patterns[]) throws MetaphraseException
semanticClasses - the array of SemanticClass'es this
StandardClassifier will assign. The last is the "default".
patterns - an array of Perl5 regular expressions.
public SemanticClass classify(Concept concept) throws MetaphraseException
concept - a Metaphrase Concept.
public int classIndex(Concept concept) throws MetaphraseException
concept - a Metaphrase Concept.
public int classIndex(SemanticType semanticTypes[],
java.lang.String origin)
semanticTypes - SemanticType[]
origin - the origin (a String)
public int classIndex(java.lang.String target)
target - String to match against.
All Packages Class Hierarchy This Package Previous Next Index