All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.Lexical.Metaphrase.StandardClassifier

java.lang.Object
    |
    +----COM.Lexical.Metaphrase.SemanticClassifier
            |
            +----COM.Lexical.Metaphrase.StandardClassifier

public class StandardClassifier
extends SemanticClassifier
Metaphrase StandardClassifier class. A standard, run-time configurable, SemanticClassifier.

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.

Version:
Authority1.1, 11 Apr 2000

Constructor Index

 o StandardClassifier(SemanticClass[], String[])
Create a StandardClassifier.

Method Index

 o classify(Concept)
Returns SemanticClass of Concept.
 o classIndex(Concept)
Returns index of SemanticClass of Concept.
 o classIndex(SemanticType[], String)
Returns index of SemanticClass given SemanticType's and origin.
 o classIndex(String)
Returns index of SemanticClass for target.

Constructor Detail

 o StandardClassifier
public StandardClassifier(SemanticClass semanticClasses[],
                          java.lang.String patterns[]) throws MetaphraseException
          Create a StandardClassifier.
Parameters:
semanticClasses - the array of SemanticClass'es this StandardClassifier will assign. The last is the "default".
patterns - an array of Perl5 regular expressions.
Throws:
MetaphraseException - thrown if patterns.length != semanticClasses.length-1 or one of patterns fails to compile.

Method Detail

 o classify
public SemanticClass classify(Concept concept) throws MetaphraseException
          Returns SemanticClass of Concept.
Parameters:
concept - a Metaphrase Concept.
Throws:
MetaphraseException - thrown in case of an error accessing the atoms list.
Overrides:
classify in class SemanticClassifier
 o classIndex
public int classIndex(Concept concept) throws MetaphraseException
          Returns index of SemanticClass of Concept.
Parameters:
concept - a Metaphrase Concept.
Throws:
MetaphraseException - thrown in case of an error accessing the atoms list.
 o classIndex
public int classIndex(SemanticType semanticTypes[],
                      java.lang.String origin)
          Returns index of SemanticClass given SemanticType's and origin.
Parameters:
semanticTypes - SemanticType[]
origin - the origin (a String)
 o classIndex
public int classIndex(java.lang.String target)
          Returns index of SemanticClass for target.
Parameters:
target - String to match against.

All Packages  Class Hierarchy  This Package  Previous  Next  Index