sk.sav.ui.ikt.nlp.gazetteer.character
Class CharacterGazetteer

java.lang.Object
  extended by sk.sav.ui.ikt.nlp.gazetteer.Gazetteer
      extended by sk.sav.ui.ikt.nlp.gazetteer.character.CharacterGazetteer

public class CharacterGazetteer
extends Gazetteer


Nested Class Summary
static class CharacterGazetteer.Representation
          Gazetteer tree representations
 
Field Summary
 long ENTITIES
           
 long INPUT_CHARACTERS_COUNT
           
 
Constructor Summary
CharacterGazetteer(CharacterGazetteer.Representation r, boolean caseSensitive)
           
 
Method Summary
 List<int[]> find(InputStream is)
          Performs a search in the specified input stream of text for known entities defined in the gazetteer's list.
 List<int[]> find(String s)
          Performs a search in the specified string for known entities defined in the gazetteer's list.
 Node getRoot()
           
 void insert(String s)
          Inserts an entity into the gazetteer's list.
 void insert(String s, int id)
          This method has the same behavior as Gazetteer.insert(String) except that an ID can be assigned to the inserted entity.
 List<int[]> match(PushbackReader reader)
           
 
Methods inherited from class sk.sav.ui.ikt.nlp.gazetteer.Gazetteer
addResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITIES

public long ENTITIES

INPUT_CHARACTERS_COUNT

public long INPUT_CHARACTERS_COUNT
Constructor Detail

CharacterGazetteer

public CharacterGazetteer(CharacterGazetteer.Representation r,
                          boolean caseSensitive)
Method Detail

getRoot

public Node getRoot()

insert

public void insert(String s)
Description copied from class: Gazetteer
Inserts an entity into the gazetteer's list. Duplicate entities won't be inserted. Entities can be inserted into the gazetteer's list anytime between calling of methods Gazetteer.find(String) and Gazetteer.find(InputStream).

Specified by:
insert in class Gazetteer
Parameters:
s - - entity to be inserted into the gazetteer's list

insert

public void insert(String s,
                   int id)
Description copied from class: Gazetteer
This method has the same behavior as Gazetteer.insert(String) except that an ID can be assigned to the inserted entity. There can be multiple ids assigned for the same entity by calling this method again but with different ID values.

Specified by:
insert in class Gazetteer
Parameters:
s - - entity to be inserted into the gazetteer's list
id - - ID to be assigned the entity represented by string s

find

public List<int[]> find(String s)
Description copied from class: Gazetteer
Performs a search in the specified string for known entities defined in the gazetteer's list.

Specified by:
find in class Gazetteer
Parameters:
s - - text to be searched
Returns:
A list of results, where each result is an array of integers with following structure: [start position, end position, ID1, ID2, ...]

find

public List<int[]> find(InputStream is)
                 throws IOException
Description copied from class: Gazetteer
Performs a search in the specified input stream of text for known entities defined in the gazetteer's list.

Specified by:
find in class Gazetteer
Parameters:
is - - input steam of text to be searched
Returns:
A list of results, where each result is an array of integers with following structure: [start position, end position, ID1, ID2, ...]
Throws:
IOException

match

public List<int[]> match(PushbackReader reader)
                  throws IOException
Throws:
IOException