@@ -30,33 +30,30 @@ public class WordToSentenceProcessorTest extends TestCase {
30
30
31
31
32
32
private static void checkResult (WordToSentenceProcessor <CoreLabel > wts ,
33
- String testSentence , String ... gold ) {
33
+ String testSentence , String ... gold ) {
34
34
checkResult (wts , ud , testSentence , gold );
35
35
}
36
36
37
37
private static void checkResult (WordToSentenceProcessor <CoreLabel > wts ,
38
38
Annotator tokenizer ,
39
- String testSentence , String ... gold ) {
39
+ String testSentence , String ... gold ) {
40
40
Annotation annotation = new Annotation (testSentence );
41
41
udNL .annotate (annotation );
42
42
List <CoreLabel > tokens = annotation .get (CoreAnnotations .TokensAnnotation .class );
43
43
List <List <CoreLabel >> sentences = wts .process (tokens );
44
44
45
- assertEquals ("Output number of sentences didn't match:\n " +
46
- Arrays .toString (gold ) + " vs. \n " + sentences + '\n' ,
47
- gold .length , sentences .size ());
45
+ assertEquals ("Output number of sentences didn't match:\n " + Arrays .toString (gold ) + " vs. \n " + sentences + '\n' ,
46
+ gold .length , sentences .size ());
48
47
49
48
Annotation [] goldAnnotations = new Annotation [gold .length ];
50
49
for (int i = 0 ; i < gold .length ; ++i ) {
51
50
goldAnnotations [i ] = new Annotation (gold [i ]);
52
51
tokenizer .annotate (goldAnnotations [i ]);
53
- List <CoreLabel > goldTokens =
54
- goldAnnotations [i ].get (CoreAnnotations .TokensAnnotation .class );
52
+ List <CoreLabel > goldTokens = goldAnnotations [i ].get (CoreAnnotations .TokensAnnotation .class );
55
53
List <CoreLabel > testTokens = sentences .get (i );
56
54
int goldTokensSize = goldTokens .size ();
57
- assertEquals ("Sentence lengths didn't match:\n " +
58
- goldTokens + " vs. \n " + testTokens + '\n' ,
59
- goldTokensSize , testTokens .size ());
55
+ assertEquals ("Sentence lengths didn't match:\n " + goldTokens + " vs. \n " + testTokens + '\n' ,
56
+ goldTokensSize , testTokens .size ());
60
57
for (int j = 0 ; j < goldTokensSize ; ++j ) {
61
58
assertEquals (goldTokens .get (j ).word (), testTokens .get (j ).word ());
62
59
}
@@ -215,9 +212,9 @@ public void testExclamationPoint() {
215
212
216
213
public void testChinese () {
217
214
checkResult (cwts , wsNL ,"巴拉特 说 : 「 我们 未 再 获得 任何 结果 。 」 < 金融时报 ? > 《 金融时报 》 周三" ,
218
- "巴拉特 说 : 「 我们 未 再 获得 任何 结果 。 」" ,
219
- "< 金融时报 ? >" ,
220
- "《 金融时报 》 周三" );
215
+ "巴拉特 说 : 「 我们 未 再 获得 任何 结果 。 」" ,
216
+ "< 金融时报 ? >" ,
217
+ "《 金融时报 》 周三" );
221
218
222
219
}
223
220
0 commit comments