org.itc.irst.tcc.ties.bwi
Class Affix

java.lang.Object
  extended byorg.itc.irst.tcc.ties.bwi.Affix
All Implemented Interfaces:
java.io.Serializable

public final class Affix
extends java.lang.Object
implements java.io.Serializable

An Affix object stores both Pattern and locations in the example set where the pattern does match and doesn't, matchOk and matchWrong respectively.

The class implements the Serializable interface so that instances may be saved to disk if desired.

Since:
1.0
Version:
%I%, %G%
Author:
Claudio Giuliano
See Also:
PatternTable, Pattern, PatternMatches, Serialized Form

Field Summary
 double cv
           
 double cvs
           
(package private) static org.apache.log4j.Logger logger
          Define a static logger variable so that it references the Logger instance named Affix.
static int MAX_INDEX_TO_STRING
          The max number of indexes printed.
private  Pattern pattern
          The pattern.
private  PatternMatches patternMatches
          The list of ok and wrong matches for this pattern.
 
Constructor Summary
Affix(int pattType)
          Constructs an ampty Affix.
Affix(Pattern pattern, PatternMatches patternMatches)
          Constructs an Affix.
 
Method Summary
 IndexList getMatchOk()
          Gets the list of correct matches into the text.
 IndexList getMatchWrong()
          Gets the list of wrong matches into the text.
 Pattern getPattern()
          Returns the pattern.
 PatternMatches getPatternMatches()
          Gets the list of wrong matches into the text.
 int getPatternType()
          Returns the pattern type.
 int hashCode()
          Returns the hash code value for this affix.
 boolean isEmpty()
          Tests if this affix has an empty pattern.
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Returns a String object representing this Affix.
 java.lang.String toXML()
          Returns a String object representing this Affix in XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Define a static logger variable so that it references the Logger instance named Affix.


pattern

private Pattern pattern
The pattern.


patternMatches

private PatternMatches patternMatches
The list of ok and wrong matches for this pattern.


MAX_INDEX_TO_STRING

public static final int MAX_INDEX_TO_STRING
The max number of indexes printed.

See Also:
Constant Field Values

cv

public double cv

cvs

public double cvs
Constructor Detail

Affix

public Affix(int pattType)
Constructs an ampty Affix.

Parameters:
pattType - the pattern type.

Affix

public Affix(Pattern pattern,
             PatternMatches patternMatches)
Constructs an Affix.

Parameters:
pattern - the pattern.
Method Detail

getPattern

public Pattern getPattern()
Returns the pattern.

Returns:
the pattern.

isEmpty

public boolean isEmpty()
Tests if this affix has an empty pattern.

Returns:
true if and only if this affix has an empty pattern, that is, the pattern length is zero; false otherwise.

getPatternType

public int getPatternType()
Returns the pattern type.

Returns:
the pattern type.

getMatchOk

public IndexList getMatchOk()
Gets the list of correct matches into the text.

Returns:
the list of correct matches.

getMatchWrong

public IndexList getMatchWrong()
Gets the list of wrong matches into the text.

Returns:
the list of wrong matches.

getPatternMatches

public PatternMatches getPatternMatches()
Gets the list of wrong matches into the text.

Returns:
the list of wrong matches.

hashCode

public int hashCode()
Returns the hash code value for this affix. Note that the hash code returned is the one returned by the pattern.

Returns:
the hash code value for this affix.

toString

public java.lang.String toString()
Returns a String object representing this Affix.

Returns:
a string representation of the object.

toXML

public java.lang.String toXML()
Returns a String object representing this Affix in XML.

Returns:
a string representation of the object in XML.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception