Search in sources :

Example 1 with SimpleGazetteerAnnotatorConfigurator

use of edu.illinois.cs.cogcomp.edison.config.SimpleGazetteerAnnotatorConfigurator in project cogcomp-nlp by CogComp.

the class SimpleGazetteerAnnotatorTest method testSimpleGazetteerAnnotatorString.

/**
     * Test method for {@link SimpleGazetteerAnnotator#SimpleGazetteerAnnotator(ResourceManager)}.
     * 
     * @throws URISyntaxException
     * @throws IOException
     */
@Test
public void testSimpleGazetteerAnnotatorString() throws IOException, URISyntaxException {
    Properties props = new Properties();
    props.setProperty(SimpleGazetteerAnnotatorConfigurator.PATH_TO_DICTIONARIES.key, "/testgazetteers/");
    props.setProperty(SimpleGazetteerAnnotatorConfigurator.IS_LAZILY_INITIALIZED.key, SimpleGazetteerAnnotatorConfigurator.FALSE);
    ResourceManager localRm = new SimpleGazetteerAnnotatorConfigurator().getConfig(new ResourceManager(props));
    SimpleGazetteerAnnotator sga = new SimpleGazetteerAnnotator(localRm);
    assertTrue("Wrong number of dictionaries loaded.", sga.dictionaries.size() == 1);
    assertTrue("Wrong number of dictionaries loaded.", sga.dictionariesIgnoreCase.size() == 1);
}
Also used : SimpleGazetteerAnnotatorConfigurator(edu.illinois.cs.cogcomp.edison.config.SimpleGazetteerAnnotatorConfigurator) ResourceManager(edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

ResourceManager (edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager)1 SimpleGazetteerAnnotatorConfigurator (edu.illinois.cs.cogcomp.edison.config.SimpleGazetteerAnnotatorConfigurator)1 Properties (java.util.Properties)1 Test (org.junit.Test)1