[ https://issues.apache.org/jira/browse/OPENNLP-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16578978#comment-16578978 ]
ASF GitHub Bot commented on OPENNLP-1212: ----------------------------------------- kojisekig closed pull request #327: OPENNLP-1212: TokenFeatureGeneratorFactory doesn't allow us to set lo… URL: https://github.com/apache/opennlp/pull/327 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/TokenFeatureGeneratorFactory.java b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenFeatureGeneratorFactory.java index 20612f56d..666030516 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenFeatureGeneratorFactory.java +++ b/opennlp-tools/src/main/java/opennlp/tools/util/featuregen/TokenFeatureGeneratorFactory.java @@ -44,6 +44,6 @@ static void register(Map<String, GeneratorFactory.XmlFeatureGeneratorFactory> fa @Override public AdaptiveFeatureGenerator create() throws InvalidFormatException { - return new TokenFeatureGenerator(); + return new TokenFeatureGenerator(getBool("lowercase", true)); } } diff --git a/opennlp-tools/src/main/resources/opennlp/tools/namefind/ner-default-features.xml b/opennlp-tools/src/main/resources/opennlp/tools/namefind/ner-default-features.xml index 1f60ad18b..d95549f4a 100644 --- a/opennlp-tools/src/main/resources/opennlp/tools/namefind/ner-default-features.xml +++ b/opennlp-tools/src/main/resources/opennlp/tools/namefind/ner-default-features.xml @@ -27,7 +27,9 @@ <generator class="opennlp.tools.util.featuregen.WindowFeatureGeneratorFactory"> <int name="prevLength">2</int> <int name="nextLength">2</int> - <generator class="opennlp.tools.util.featuregen.TokenFeatureGeneratorFactory"/> + <generator class="opennlp.tools.util.featuregen.TokenFeatureGeneratorFactory"> + <bool name="lowercase">true</bool> + </generator> </generator> <generator class="opennlp.tools.util.featuregen.DefinitionFeatureGeneratorFactory"/> <generator class="opennlp.tools.util.featuregen.PreviousMapFeatureGeneratorFactory"/> ---------------------------------------------------------------- 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: us...@infra.apache.org > TokenFeatureGeneratorFactory doesn't allow us to set lowercase flag > ------------------------------------------------------------------- > > Key: OPENNLP-1212 > URL: https://issues.apache.org/jira/browse/OPENNLP-1212 > Project: OpenNLP > Issue Type: Bug > Affects Versions: 1.9.0 > Reporter: Koji Sekiguchi > Priority: Minor > Fix For: 1.9.1 > > > As TokenFeatureGenerator can accept lowercase flag but > TokenFeatureGeneratorFactory doesn't allow us to set lowercase flag, > TokenFeatureGenerator always return lowercase tokens. -- This message was sent by Atlassian JIRA (v7.6.3#76005)