org.itc.irst.tcc.ties.data.patterns
Class PatternMatches

java.lang.Object
  extended byorg.itc.irst.tcc.ties.data.patterns.PatternMatches
All Implemented Interfaces:
java.io.Serializable

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

An Affix object (the parent of Prefix and Suffix) stores both Pattern and places in the corpus 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:
IndexList, Serialized Form

Field Summary
(package private) static org.apache.log4j.Logger logger
          Define a static logger variable so that it references the Logger instance named PatternMatches.
private  IndexList matchOk
          The list of correct matches for this pattern.
private  IndexList matchWrong
          The list of wrong matches for this pattern.
static int MAX_INDEX_TO_STRING
          The max number of indexes printed.
private  int ok
           
private  int wrong
           
 
Constructor Summary
PatternMatches()
          Constructs an empty PatternMatches.
PatternMatches(IndexList matchOk, IndexList matchWrong)
          Constructs an empty PatternMatches.
 
Method Summary
 void addMatchOk(int index)
          Adds the index to the correct match.
 void addMatchWrong(int index)
          Adds the index to the wrong match.
 PatternMatches getIntersection(PatternMatches pm)
          Returns the intersection between this object and the specified index list.
 IndexList getMatchOk()
          Gets the list of correct matches into the text.
 IndexList getMatchWrong()
          Gets the list of wrong matches into the text.
 int getOk()
           
 int getWrong()
           
static void main(java.lang.String[] args)
           
 void setOk(int ok)
           
 void setWrong(int wrong)
           
 java.lang.String toString()
          Returns a String object representing this PatternMatches.
 java.lang.String toXml()
          Returns a String object representing this PatternMatches in XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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 PatternMatches.


matchOk

private IndexList matchOk
The list of correct matches for this pattern.


matchWrong

private IndexList matchWrong
The list of 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

ok

private int ok

wrong

private int wrong
Constructor Detail

PatternMatches

public PatternMatches()
Constructs an empty PatternMatches.


PatternMatches

public PatternMatches(IndexList matchOk,
                      IndexList matchWrong)
Constructs an empty PatternMatches.

Method Detail

addMatchOk

public void addMatchOk(int index)
Adds the index to the correct match.

Parameters:
index - the index into the chart list.

addMatchWrong

public void addMatchWrong(int index)
Adds the index to the wrong match.

Parameters:
index - the index into the chart list.

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.

getIntersection

public PatternMatches getIntersection(PatternMatches pm)
Returns the intersection between this object and the specified index list.

Returns:
the intersection between this object and the specified index list.

toString

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

Returns:
a string representation of the object.

toXml

public java.lang.String toXml()
Returns a String object representing this PatternMatches in XML.

Returns:
a string representation of the object in XML.

setOk

public void setOk(int ok)

setWrong

public void setWrong(int wrong)

getOk

public int getOk()

getWrong

public int getWrong()

main

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