ca.uottawa.balie
Class PunctLookup

java.lang.Object
  extended by ca.uottawa.balie.PunctLookup
All Implemented Interfaces:
java.io.Serializable

public class PunctLookup
extends java.lang.Object
implements java.io.Serializable

Wraps around a hashtable that contains a list of punctuation. Also offers service functions to resolve punctuation equivalence.

Author:
nadeaud
See Also:
Serialized Form

Constructor Summary
PunctLookup()
          Initializes the hashtable with the punctuation lookup and equivalences.
 
Method Summary
 java.lang.String GetPunctEquivalence(java.lang.String pi_Char)
          Gets the equivalent char to a given punctuation (e.g.: every quote characters are equivalent with the char '"')
 int GetPunctType(java.lang.String pi_Char)
          Gets the punctuation type (e.g.: '.' is period) of a char
 boolean IsInternalPunct(char pi_Char)
          Checks if a char is an internal punctuation that is not welcome inside a word (ex.: '.' or ',' or ':')
 boolean IsPunctuation(char pi_Char)
          Determines wether or not a given char is a known punctuation in Balie.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PunctLookup

public PunctLookup()
Initializes the hashtable with the punctuation lookup and equivalences.

Method Detail

GetPunctType

public int GetPunctType(java.lang.String pi_Char)
Gets the punctuation type (e.g.: '.' is period) of a char

Parameters:
pi_Char - String of lenght 1
Returns:
The punctuation type (see TokenConsts for enumeration)
See Also:
TokenConsts

IsPunctuation

public boolean IsPunctuation(char pi_Char)
Determines wether or not a given char is a known punctuation in Balie.

Parameters:
pi_Char - The char to test
Returns:
True if the char is a punctuation in Balie.

GetPunctEquivalence

public java.lang.String GetPunctEquivalence(java.lang.String pi_Char)
Gets the equivalent char to a given punctuation (e.g.: every quote characters are equivalent with the char '"')

Parameters:
pi_Char - String (typically of lenght 1) for which we want the equivalent representation.
Returns:
The equivalent string

IsInternalPunct

public boolean IsInternalPunct(char pi_Char)
Checks if a char is an internal punctuation that is not welcome inside a word (ex.: '.' or ',' or ':')

Parameters:
pi_Char - The char to test
Returns:
True if the char is an internal punctuation that is not welcome inside a word.