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

java.lang.Object
  extended byorg.itc.irst.tcc.ties.bwi.PatternTable

public class PatternTable
extends java.lang.Object

A PatternTable object maps Patterns to Affixes for a fast retrivial. Any non-null Affix can be put into the table.

Since:
1.0
Version:
%I%, %G%
Author:
Claudio Giuliano
See Also:
Pattern, Affix

Field Summary
(package private) static org.apache.log4j.Logger logger
          Define a static logger variable so that it references the Logger instance named PatternTable.
private  java.util.HashMap patternTable
          The hashtable containing the affixes.
 
Constructor Summary
PatternTable()
          Constructs an empty PatternTable.
 
Method Summary
 boolean containsPattern(Pattern pattern)
           
 java.util.Set entrySet()
          Returns an enumeration of the patterns in this table.
 Affix get(Pattern pattern)
           
 java.util.Set keySet()
          Returns an enumeration of the patterns in this table.
static void main(java.lang.String[] args)
           
 void put(Affix affix)
          Maps the specified pattern to the specified Affix in this table.
private  void put(Pattern pattern, Affix affix)
          Maps the specified pattern to the specified Affix in this table.
 int size()
          Returns the number of pattern in this table.
 java.lang.String toString()
          Returns a String object representing this PatternTable.
 java.util.Collection values()
          Returns an enumeration of the patterns in this table.
 
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 PatternTable.


patternTable

private java.util.HashMap patternTable
The hashtable containing the affixes. The tags are the keys and the list of examples are the values.

Constructor Detail

PatternTable

public PatternTable()
Constructs an empty PatternTable.

Method Detail

put

public void put(Affix affix)
Maps the specified pattern to the specified Affix in this table. Neither the key nor the value can be null.

Parameters:
affix - the position into the text.

put

private void put(Pattern pattern,
                 Affix affix)
Maps the specified pattern to the specified Affix in this table. Neither the key nor the value can be null.

Parameters:
pattern - the pattern.
affix - the position into the text.

get

public Affix get(Pattern pattern)

containsPattern

public boolean containsPattern(Pattern pattern)

entrySet

public java.util.Set entrySet()
Returns an enumeration of the patterns in this table.

Returns:
an enumeration of the patterns in this table.

keySet

public java.util.Set keySet()
Returns an enumeration of the patterns in this table.

Returns:
an enumeration of the patterns in this table.

size

public int size()
Returns the number of pattern in this table.

Returns:
the number of pattern in this table.

values

public java.util.Collection values()
Returns an enumeration of the patterns in this table.

Returns:
an enumeration of the patterns in this table.

toString

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

Returns:
a string representation of the object.

main

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