![JAR search and dependency download from the Maven repository](/logo.png)
resources.NE.gender.jape Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annie Show documentation
Show all versions of annie Show documentation
ANNIE is a general purpose information extraction system that
provides the building blocks of many other GATE applications.
//gender.jape
//this is a sample jape grammar to be used with the
//Onto Gazetteer demo.
//borilsav popov
//ontotext
//01 may 2002
// intended use: determine the gender given the CLASS annotation over a person name.
Phase: Gender
Input: Token Lookup
Options: control = brill
Rule: isFemale
(
{
Lookup.class == female_person_first_name,
Lookup.ontology == "gate:/creole/ontology/demo.daml"
}
):person
-->
{
gate.AnnotationSet person = (gate.AnnotationSet)bindings.get("person");
gate.Annotation personAnn = (gate.Annotation)person.iterator().next();
gate.FeatureMap features = Factory.newFeatureMap();
features.put("gender", "female");
features.put("rule", "isFemale");
outputAS.add(person.firstNode(), person.lastNode(), "isFemale",
features);
}
Rule: isMale
(
{
Lookup.class == male_person_first_name,
Lookup.ontology == "gate:/creole/ontology/demo.daml"
}
):person
-->
{
gate.AnnotationSet person = (gate.AnnotationSet)bindings.get("person");
gate.Annotation personAnn = (gate.Annotation)person.iterator().next();
gate.FeatureMap features = Factory.newFeatureMap();
features.put("gender", "male");
features.put("rule", "isMale");
outputAS.add(person.firstNode(), person.lastNode(), "isMale",
features);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy