Revision: 17354
          http://sourceforge.net/p/gate/code/17354
Author:   dgmaynard
Date:     2014-02-20 09:18:32 +0000 (Thu, 20 Feb 2014)
Log Message:
-----------
Denmark no longer smells of fish.

Modified Paths:
--------------
    gate/trunk/plugins/ANNIE/resources/NE/name.jape

Modified: gate/trunk/plugins/ANNIE/resources/NE/name.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/name.jape     2014-02-19 18:28:51 UTC 
(rev 17353)
+++ gate/trunk/plugins/ANNIE/resources/NE/name.jape     2014-02-20 09:18:32 UTC 
(rev 17354)
@@ -598,6 +598,56 @@
 
 }
 
+Rule:  PersonMiddleInitial
+Priority: 10
+// Fred C. Jones
+
+
+(
+ 
+  (FIRSTNAME | FIRSTNAMEAMBIG ):firstName
+  ({Initials}):initials
+ ((PREFIX)*
+  ({Upper,!Initials})
+  (PERSONENDING)?
+ ):surname
+):person -->
+{
+ gate.FeatureMap features = Factory.newFeatureMap();
+ gate.AnnotationSet personSet = (gate.AnnotationSet)bindings.get("person");
+ gate.Annotation personAnn = (gate.Annotation)personSet.iterator().next();
+  
+  gate.AnnotationSet firstNameSet = 
(gate.AnnotationSet)bindings.get("firstName");
+  gate.Annotation firstNameAnn = 
(gate.Annotation)firstNameSet.iterator().next();
+ 
+ String firstNameContent = gate.Utils.stringFor(doc, firstNameAnn);
+ features.put("firstName", firstNameContent);
+ features.put("gender", firstNameAnn.getFeatures().get("gender"));
+
+ gate.AnnotationSet initialsSet = (gate.AnnotationSet)bindings.get("initials");
+
+ if (initialsSet != null && initialsSet.size()>0)
+{
+ gate.Annotation initialsAnn = (gate.Annotation)initialsSet.iterator().next();
+ String initialsContent = gate.Utils.stringFor(doc, initialsAnn);
+ features.put("initials", initialsContent);
+}
+
+ gate.AnnotationSet surnameSet = (gate.AnnotationSet)bindings.get("surname");
+ gate.Annotation surnameAnn = (gate.Annotation)surnameSet.iterator().next();
+
+ String surnameContent = gate.Utils.stringFor(doc, surnameAnn);
+ features.put("surname", surnameContent);
+
+ features.put("kind", "fullName");
+ features.put("rule", "PersonFull");
+outputAS.add(personSet.firstNode(), personSet.lastNode(), "TempPerson",
+features);
+
+}
+
+
+
 Rule: PersonFullStop
 Priority: 50
 // G.Wilson Fri

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to