Remove calls to String.toString()

See issue OPENNLP-871


Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo
Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/b854d314
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/b854d314
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/b854d314

Branch: refs/heads/trunk
Commit: b854d3142b718aff8f44077bbbb1905dc455364d
Parents: c479846
Author: Jörn Kottmann <[email protected]>
Authored: Wed Nov 2 19:47:18 2016 +0100
Committer: Jörn Kottmann <[email protected]>
Committed: Mon Dec 19 23:37:33 2016 +0100

----------------------------------------------------------------------
 .../tools/lemmatizer/DefaultLemmatizerContextGenerator.java        | 2 +-
 .../java/opennlp/tools/postag/DefaultPOSSequenceValidator.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/opennlp/blob/b854d314/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
----------------------------------------------------------------------
diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
 
b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
index c271ab4..e455f01 100644
--- 
a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
+++ 
b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
@@ -67,7 +67,7 @@ public class DefaultLemmatizerContextGenerator implements 
LemmatizerContextGener
     // Previous prediction
     String p_1;
 
-    String lex = toks[index].toString();
+    String lex = toks[index];
     if (index < 1) {
       p_1 = "p_1=bos";
     }

http://git-wip-us.apache.org/repos/asf/opennlp/blob/b854d314/opennlp-tools/src/main/java/opennlp/tools/postag/DefaultPOSSequenceValidator.java
----------------------------------------------------------------------
diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/postag/DefaultPOSSequenceValidator.java
 
b/opennlp-tools/src/main/java/opennlp/tools/postag/DefaultPOSSequenceValidator.java
index 56530ae..0d82e0b 100644
--- 
a/opennlp-tools/src/main/java/opennlp/tools/postag/DefaultPOSSequenceValidator.java
+++ 
b/opennlp-tools/src/main/java/opennlp/tools/postag/DefaultPOSSequenceValidator.java
@@ -34,7 +34,7 @@ public class DefaultPOSSequenceValidator implements 
SequenceValidator<String> {
     if (tagDictionary == null) {
       return true;
     } else {
-      String[] tags = tagDictionary.getTags(inputSequence[i].toString());
+      String[] tags = tagDictionary.getTags(inputSequence[i]);
       if (tags == null) {
         return true;
       } else {

Reply via email to