gate.plugins.Lang_French.grammar.gender.jape Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gate-extraction Show documentation
Show all versions of gate-extraction Show documentation
Gate based component, that can process the Text units to extract informations using Gate's tools (such as grammars, gazetteers, tokenizer or POS Taggers).
This project contains two versions, a simple component and webservice one.
//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 - 2024 Weber Informatics LLC | Privacy Policy