Revision: 17859
http://sourceforge.net/p/gate/code/17859
Author: adamfunk
Date: 2014-04-17 15:01:42 +0000 (Thu, 17 Apr 2014)
Log Message:
-----------
Term candidate threshold grammar (new & improved version)
Added Paths:
-----------
gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
Added:
gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
===================================================================
--- gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
(rev 0)
+++ gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
2014-04-17 15:01:42 UTC (rev 17859)
@@ -0,0 +1,26 @@
+Phase: TermCandidate
+Input: SingleWord MultiWord
+Options: control = all
+
+Rule: TermCandidate
+({SingleWord}|{MultiWord}):match
+-->
+:match {
+ Annotation ann = gate.Utils.getOnlyAnn(matchAnnots);
+ FeatureMap oldf = ann.getFeatures();
+ double threshold = 50.0; // fallback
+ if (ctx.getPRFeatures().containsKey("threshold")) {
+ threshold =
Double.parseDouble(ctx.getPRFeatures().get("threshold").toString());
+ }
+
+ if (oldf.containsKey("tfIdfAug") &&
+ (((Double) oldf.get("tfIdfAug")) > threshold) ) {
+ Long start = ann.getStartNode().getOffset();
+ Long end = ann.getEndNode().getOffset();
+
+ FeatureMap newf = Factory.newFeatureMap();
+ newf.putAll(oldf);
+
+ gate.Utils.addAnn(outputAS, ann, "Term", newf);
+ }
+}
Property changes on:
gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
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/NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs