[ 
https://issues.apache.org/jira/browse/OPENNLP-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539576#comment-16539576
 ] 

ASF GitHub Bot commented on OPENNLP-1206:
-----------------------------------------

kojisekig closed pull request #324: OPENNLP-1206: add 
TrigramNameFeatureGeneratorFactory
URL: https://github.com/apache/opennlp/pull/324
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TrigramNameFeatureGeneratorFactory.java
 
b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TrigramNameFeatureGeneratorFactory.java
new file mode 100644
index 000000000..e9a4c3484
--- /dev/null
+++ 
b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TrigramNameFeatureGeneratorFactory.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package opennlp.tools.util.featuregen;
+
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+import opennlp.tools.util.InvalidFormatException;
+
+public class TrigramNameFeatureGeneratorFactory
+    extends GeneratorFactory.AbstractXmlFeatureGeneratorFactory
+    implements GeneratorFactory.XmlFeatureGeneratorFactory {
+
+  public TrigramNameFeatureGeneratorFactory() {
+    super();
+  }
+
+  @Deprecated // TODO: (OPENNLP-1174) just remove when back-compat is no 
longer needed
+  public AdaptiveFeatureGenerator create(Element generatorElement,
+                                         FeatureGeneratorResourceProvider 
resourceManager) {
+
+    return new TrigramNameFeatureGenerator();
+  }
+
+  @Deprecated // TODO: (OPENNLP-1174) just remove when back-compat is no 
longer needed
+  static void register(Map<String, 
GeneratorFactory.XmlFeatureGeneratorFactory> factoryMap) {
+    factoryMap.put("trigram", new TrigramNameFeatureGeneratorFactory());
+  }
+
+  @Override
+  public AdaptiveFeatureGenerator create() throws InvalidFormatException {
+    return new TrigramNameFeatureGenerator();
+  }
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> add TrigramNameFeatureGeneratorFactory
> --------------------------------------
>
>                 Key: OPENNLP-1206
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1206
>             Project: OpenNLP
>          Issue Type: Task
>          Components: Machine Learning
>    Affects Versions: 1.8.4
>            Reporter: Koji Sekiguchi
>            Assignee: Koji Sekiguchi
>            Priority: Minor
>
> Surprisingly, it's missing. :) I noticed it when I tried to use it in my 
> feature generator XML.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to