Examples of Gazetteer


Examples of com.bericotech.clavin.gazetteer.query.Gazetteer

     * @throws ClavinException      If the index cannot be created.
     */
    public static GeoParser getDefault(String pathToLuceneIndex, LocationExtractor extractor, int maxHitDepth,
            int maxContentWindow, boolean fuzzy) throws ClavinException {
        // instantiate new LuceneGazetteer
        Gazetteer gazetteer = new LuceneGazetteer(new File(pathToLuceneIndex));
        return new GeoParser(extractor, gazetteer, maxHitDepth, maxContentWindow, fuzzy);
    }
View Full Code Here

Examples of com.bericotech.clavin.gazetteer.query.Gazetteer

            String modelToUse = CliffConfig.getInstance().getNerModelName();
            logger.debug("Creating extractor with "+modelToUse);
            StanfordNamedEntityExtractor locationExtractor = new StanfordNamedEntityExtractor(Model.valueOf(modelToUse));               
           
            boolean useFuzzyMatching = false;
            Gazetteer gazetteer = new LuceneGazetteer(new File(PATH_TO_GEONAMES_INDEX));
            resolver = new CliffLocationResolver(gazetteer);

            parser = new EntityParser(locationExtractor, resolver, useFuzzyMatching);
                       
            logger.info("Created parser successfully");
View Full Code Here

Examples of com.bericotech.clavin.gazetteer.query.Gazetteer

public class CustomLuceneLocationResolverTest {

    @Test
    public void testGetByGeoNameId() throws Exception {
        Gazetteer gazetteer = new LuceneGazetteer(new File(ParseManager.PATH_TO_GEONAMES_INDEX));
        CliffLocationResolver resolver = new CliffLocationResolver(gazetteer);
        GeoName geoName = resolver.getByGeoNameId(6252001);
        assertEquals(geoName.getGeonameID(),6252001);
        assertEquals(geoName.getName(),"United States");
        assertEquals(geoName.getFeatureCode(),FeatureCode.PCLI);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.