aboutsummaryrefslogtreecommitdiffstats
path: root/linguistics
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2021-12-20 14:18:48 +0100
committerGitHub <noreply@github.com>2021-12-20 14:18:48 +0100
commit22581d57b03550f07aa38a5f1c93ba54cedb6db1 (patch)
tree5abf4e133ccb34f1e4f6b01c72240126290a065f /linguistics
parenta8908be0652c8213dbe232c3a94fe2d74994842c (diff)
Provide array of correct size.
Diffstat (limited to 'linguistics')
-rw-r--r--linguistics/src/main/java/com/yahoo/language/opennlp/DefaultLanguageDetectorContextGenerator.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/linguistics/src/main/java/com/yahoo/language/opennlp/DefaultLanguageDetectorContextGenerator.java b/linguistics/src/main/java/com/yahoo/language/opennlp/DefaultLanguageDetectorContextGenerator.java
index 8d1eb51b388..27c23d8d3e6 100644
--- a/linguistics/src/main/java/com/yahoo/language/opennlp/DefaultLanguageDetectorContextGenerator.java
+++ b/linguistics/src/main/java/com/yahoo/language/opennlp/DefaultLanguageDetectorContextGenerator.java
@@ -26,7 +26,7 @@ public class DefaultLanguageDetectorContextGenerator extends opennlp.tools.langd
for (int j = minLength; j <= maxLength && i + j < normalized.length; j++)
grams.add(new String(normalized, i, j));
- return grams.toArray(new String[0]);
+ return grams.toArray(new String[grams.size()]);
}
}