Package banner.normalization
Class Gazetteer
- java.lang.Object
-
- banner.normalization.Gazetteer
-
public class Gazetteer extends Object
A Gazetteer allows read in a list ofEntitys and their associatedEntityNames from a file. These can also be re-written to a file to simplify loading at a later time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGazetteer.EntityFilter
-
Constructor Summary
Constructors Constructor Description Gazetteer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEntity(Entity entity)Set<Entity>getEntities()EntitygetEntity(String id)voidload(Tokenizer tokenizer, EntityType type, String filename)voidload(Tokenizer tokenizer, String namesFilename)voidload(Tokenizer tokenizer, String namesFilename, Gazetteer.EntityFilter entityFilter)voidwrite(String namesFilename)A gazetteer is written as two parts, one contains the Type, ID and EntityNames and the second contains the entity relationships
-
-
-
Method Detail
-
load
public void load(Tokenizer tokenizer, EntityType type, String filename) throws IOException
- Throws:
IOException
-
load
public void load(Tokenizer tokenizer, String namesFilename) throws IOException
- Throws:
IOException
-
load
public void load(Tokenizer tokenizer, String namesFilename, Gazetteer.EntityFilter entityFilter) throws IOException
- Throws:
IOException
-
addEntity
protected void addEntity(Entity entity)
-
write
public void write(String namesFilename) throws IOException
A gazetteer is written as two parts, one contains the Type, ID and EntityNames and the second contains the entity relationships- Parameters:
type-namesFilename-relationshipFilename-- Throws:
IOException
-
-