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 2017/05/17 15:53:15 UTC
[49/50] opennlp git commit: OPENNLP-1066: Add MorfologikLemmatizer
constructor taking a Dictionary
OPENNLP-1066: Add MorfologikLemmatizer constructor taking a Dictionary
Closes #208
Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo
Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/911d59f4
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/911d59f4
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/911d59f4
Branch: refs/heads/LangDetect
Commit: 911d59f46d0dce2e07a93dc0ff705154f568b7ba
Parents: 08b2c42
Author: William D C M SILVA <co...@apache.org>
Authored: Wed May 17 12:07:28 2017 -0300
Committer: William D C M SILVA <co...@apache.org>
Committed: Wed May 17 12:07:28 2017 -0300
----------------------------------------------------------------------
.../opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/opennlp/blob/911d59f4/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java
----------------------------------------------------------------------
diff --git a/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java b/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java
index 4c9de2c..22f4282 100644
--- a/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java
+++ b/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/lemmatizer/MorfologikLemmatizer.java
@@ -39,7 +39,12 @@ public class MorfologikLemmatizer implements Lemmatizer {
public MorfologikLemmatizer(Path dictionaryPath) throws IllegalArgumentException,
IOException {
- dictLookup = new DictionaryLookup(Dictionary.read(dictionaryPath));
+ this(Dictionary.read(dictionaryPath));
+ }
+
+ public MorfologikLemmatizer(Dictionary dictionary) throws IllegalArgumentException,
+ IOException {
+ dictLookup = new DictionaryLookup(dictionary);
}
private List<String> lemmatize(String word, String postag) {