Examples of FeatureGazetteer


Examples of com.jpetrak.gate.stringannotation.extendedgazetteer2.FeatureGazetteer

    FeatureMap parms = Factory.newFeatureMap();
    File defFile = new File(testingDir,"extgaz2.def");
    URL gazURL = defFile.toURI().toURL();
    parms.put("configFileURL", gazURL);
    parms.put("backendNr",backendNr);
    FeatureGazetteer eg = (FeatureGazetteer)Factory.createResource(
            "com.jpetrak.gate.stringannotation.extendedgazetteer2.FeatureGazetteer", parms);
    // test matching directly
    Iterator<Lookup> ret = null;
    ret = eg.doMatch("some", true,true);
    System.out.println("Matching same: "+ret);
    // check that it works with a gazetteer list that does not have any features
    defFile = new File(testingDir,"extgaz3.def");
    gazURL = defFile.toURI().toURL();
    parms.put("configFileURL", gazURL);
    eg = (FeatureGazetteer)Factory.createResource(
        "com.jpetrak.gate.stringannotation.extendedgazetteer2.FeatureGazetteer", parms);
    ret = eg.doMatch("word", true,true);
    System.out.println("Matching extgaz3 'word': "+eg.lookups2FeatureMaps(ret));
    ret = eg.doMatch("word", false,false);
    System.out.println("Matching extgaz3 'word': "+eg.lookups2FeatureMaps(ret));
    ret = eg.doMatch("word", true,true);
    System.out.println("Matching extgaz3 'word': "+eg.lookups2FeatureMaps(ret));
    ret = eg.doMatch("notthere", true,true);
    System.out.println("Matching extgaz3 'notthere': "+eg.lookups2FeatureMaps(ret));
    ret = eg.doMatch("test", true,true);
    System.out.println("Matching extgaz3 'test': "+eg.lookups2FeatureMaps(ret));
    ret = eg.doMatch("text", true,true);
    System.out.println("Matching extgaz3 'text': "+eg.lookups2FeatureMaps(ret));
    ret = eg.doMatch("thewordyes", false,false);
    System.out.println("Matching extgaz3 'thewordyes': "+eg.lookups2FeatureMaps(ret));
   
    System.out.println("Feature Gazetteer application test finished");
  }
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.