sk.sav.ui.ikt.nlp.gazetteer.token
Class TokenGazetteer
java.lang.Object
sk.sav.ui.ikt.nlp.gazetteer.Gazetteer
sk.sav.ui.ikt.nlp.gazetteer.token.TokenGazetteer
public class TokenGazetteer
- extends Gazetteer
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. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TokenGazetteer
public TokenGazetteer(boolean caseSensitive,
ArrayList<Pattern> subtokenPatterns)
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 listid
- - 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