Revision: 18372
http://sourceforge.net/p/gate/code/18372
Author: markagreenwood
Date: 2014-10-10 10:06:32 +0000 (Fri, 10 Oct 2014)
Log Message:
-----------
added the suggested fix for the case were there aren't enough tokens to build a
long enough n-gram
Modified Paths:
--------------
gate/trunk/plugins/Learning/src/gate/learning/NLPFeaturesList.java
Modified: gate/trunk/plugins/Learning/src/gate/learning/NLPFeaturesList.java
===================================================================
--- gate/trunk/plugins/Learning/src/gate/learning/NLPFeaturesList.java
2014-10-10 01:20:00 UTC (rev 18371)
+++ gate/trunk/plugins/Learning/src/gate/learning/NLPFeaturesList.java
2014-10-10 10:06:32 UTC (rev 18372)
@@ -102,6 +102,11 @@
public void addFeaturesFromDoc(NLPFeaturesOfDoc fd) {
long size = featuresList.size();
for(int i = 0; i < fd.numInstances; ++i) {
+
+ //added a fix for a line without enough n-grams, for details see
+ //http://sourceforge.net/p/gate/mailman/message/26934934/
+ if (fd.featuresInLine[i]==null) continue;
+
String[] features = fd.featuresInLine[i].toString().trim().split(
ConstantParameters.ITEMSEPARATOR);
for(int j = 0; j < features.length; ++j) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs