Skip to content

Commit 7a24b58

Browse files
committed
automatically add tokenize,ssplit
1 parent f44e693 commit 7a24b58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/edu/stanford/nlp/pipeline/StanfordCoreNLP.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ public StanfordCoreNLP(Properties props, boolean enforceRequirements, AnnotatorP
245245
logger.info("preTokenized option set: Changing annotators tokenize,ssplit,mwt to tokenize,ssplit");
246246
} else if (oldAnnotators != null && oldAnnotators.startsWith("tokenize,ssplit")) {
247247
logger.info("preTokenized option set: Annotators list starts with tokenize,ssplit, no change needed.");
248+
} else if (oldAnnotators != null && !oldAnnotators.contains("tokenize") && !oldAnnotators.contains("mwt")
249+
&& !oldAnnotators.contains("ssplit") && !oldAnnotators.contains("cdc_tokenize")) {
250+
logger.info("preTokenized option set: Adding tokenize,ssplit to beginning.");
251+
newAnnotators = "tokenize,ssplit," + oldAnnotators;
248252
} else {
249253
logger.warn("preTokenized option set: Non-standard annotators list, preTokenized may not work in this case.");
250254
}

0 commit comments

Comments
 (0)