Skip to content

Commit 3e828eb

Browse files
committed
Update one of the tests - indices are now added. Use a more clear name other than ud for this annotator
1 parent d5d5707 commit 3e828eb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/src/edu/stanford/nlp/process/WordToSentenceProcessorTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
public class WordToSentenceProcessorTest extends TestCase {
1919

20-
private static final TokenizerAnnotator ud =
21-
new TokenizerAnnotator(false, "en");
20+
private static final TokenizerAnnotator onelineTokenizer =
21+
new TokenizerAnnotator(false, PropertiesUtils.asProperties("tokenize.language", "en", "ssplit.isOneSentence", "true"), null);
2222
private static final TokenizerAnnotator udNL =
2323
new TokenizerAnnotator(false, "en", "invertible,tokenizeNLs=true");
2424
private static final TokenizerAnnotator wsNL =
@@ -33,7 +33,7 @@ public class WordToSentenceProcessorTest extends TestCase {
3333

3434
private static void checkResult(WordToSentenceProcessor<CoreLabel> wts,
3535
String testSentence, String... gold) {
36-
checkResult(wts, ud, testSentence, gold);
36+
checkResult(wts, onelineTokenizer, testSentence, gold);
3737
}
3838

3939
private static void checkResult(WordToSentenceProcessor<CoreLabel> wts,
@@ -207,9 +207,10 @@ public void testBlankLines() {
207207

208208
public void testExclamationPoint() {
209209
Annotation annotation = new Annotation("Foo!!");
210-
ud.annotate(annotation);
210+
onelineTokenizer.annotate(annotation);
211+
// the TokenizerAnnotator will add ids by default
211212
List<CoreLabel> list = annotation.get(CoreAnnotations.TokensAnnotation.class);
212-
assertEquals("Wrong double bang", "[Foo, !!]", list.toString());
213+
assertEquals("Wrong double bang", "[Foo-1, !!-2]", list.toString());
213214
}
214215

215216
public void testChinese() {

0 commit comments

Comments
 (0)