Revision: 17717
          http://sourceforge.net/p/gate/code/17717
Author:   dgmaynard
Date:     2014-03-20 16:12:28 +0000 (Thu, 20 Mar 2014)
Log Message:
-----------
fixed some bugs with initials, allow person endings to be comma-separated, and 
improved unknown name recognition

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

Modified: gate/trunk/plugins/ANNIE/resources/NE/firstname.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/firstname.jape        2014-03-20 
14:17:24 UTC (rev 17716)
+++ gate/trunk/plugins/ANNIE/resources/NE/firstname.jape        2014-03-20 
16:12:28 UTC (rev 17717)
@@ -126,7 +126,7 @@
 
 Rule: Initials1
 (
-  ({Token.orth == upperInitial, Token.length =="1", !ClosedClass, !Lookup, 
!NumberLetter}
+  ({Token.orth == upperInitial, Token.length =="1", !ClosedClass, 
!NumberLetter}
   ({Token.string == "."})?
   )+
 ):tag

Modified: gate/trunk/plugins/ANNIE/resources/NE/name.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/name.jape     2014-03-20 14:17:24 UTC 
(rev 17716)
+++ gate/trunk/plugins/ANNIE/resources/NE/name.jape     2014-03-20 16:12:28 UTC 
(rev 17717)
@@ -40,7 +40,7 @@
 
 Macro: FIRSTNAMEAMBIG
 (
- {Lookup.majorType == person_first, Lookup.minorType == ambig}
+ {Lookup.majorType == person_first, Lookup.kind == ambig}
 )
 
 
@@ -49,6 +49,7 @@
 
 Macro: PERSONENDING
 (
+ ({Token.string == ","})?
  {Lookup.majorType == person_ending}
 )
 

Modified: gate/trunk/plugins/ANNIE/resources/NE/name_context.jape
===================================================================
--- gate/trunk/plugins/ANNIE/resources/NE/name_context.jape     2014-03-20 
14:17:24 UTC (rev 17716)
+++ gate/trunk/plugins/ANNIE/resources/NE/name_context.jape     2014-03-20 
16:12:28 UTC (rev 17717)
@@ -79,6 +79,41 @@
 }
 
 
+Rule: UnknownSurname
+Priority: 100
+(
+ ({Unknown}):firstName
+ ({Person.kind == firstName}):surname
+):person
+-->
+ {
+ gate.FeatureMap features = Factory.newFeatureMap();
+ gate.AnnotationSet personSet = (gate.AnnotationSet)bindings.get("person");
+ 
+ gate.AnnotationSet firstNameSet = 
(gate.AnnotationSet)bindings.get("firstName");
+
+ gate.AnnotationSet surnameSet = (gate.AnnotationSet)bindings.get("surname");
+ gate.Annotation surnameAnn = (gate.Annotation)surnameSet.iterator().next();
+
+
+ if (firstNameSet != null && firstNameSet.size()>0)
+ {
+  gate.Annotation firstNameAnn = 
(gate.Annotation)firstNameSet.iterator().next();
+  String firstNameContent = gate.Utils.stringFor(doc, firstNameAnn);
+  features.put("firstName", firstNameContent);
+ }
+  String surnameContent = gate.Utils.stringFor(doc, surnameAnn);
+  features.put("surname", surnameContent);
+
+  features.put("kind", "personName");
+  features.put("rule", "UnknownSurname");
+outputAS.add(personSet.firstNode(), personSet.lastNode(), "Person",
+features);
+outputAS.removeAll(surnameSet);
+}
+
+
+
 Rule:PersonTitle1
 Priority: 40
 (

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


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to