You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by co...@apache.org on 2011/06/07 04:22:09 UTC

svn commit: r1132854 - /incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderME.java

Author: colen
Date: Tue Jun  7 02:22:09 2011
New Revision: 1132854

URL: http://svn.apache.org/viewvc?rev=1132854&view=rev
Log:
OPENNLP-195 Should place the descriptor in the model

Modified:
    incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderME.java

Modified: incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderME.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderME.java?rev=1132854&r1=1132853&r2=1132854&view=diff
==============================================================================
--- incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderME.java (original)
+++ incubator/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/namefind/NameFinderME.java Tue Jun  7 02:22:09 2011
@@ -414,8 +414,16 @@ public class NameFinderME implements Tok
       ObjectStream<NameSample> samples, TrainingParameters trainParams,
       byte[] featureGeneratorBytes, final Map<String, Object> resources)
       throws IOException {
-    return train(languageCode, type, samples, trainParams,
+    
+    TokenNameFinderModel model = train(languageCode, type, samples, trainParams,
         createFeatureGenerator(featureGeneratorBytes, resources), resources);
+    
+    // place the descriptor in the model
+    if (featureGeneratorBytes != null) {
+      model = model.updateFeatureGenerator(featureGeneratorBytes);
+    }
+    
+    return model;
   }
    
    /**