@@ -52,6 +52,10 @@ public class CoNLLUReaderITest {
5252 {"sps00" , "rg" , "da0fp0" , "ncfp000" , "fp" },
5353 };
5454
55+ static final String [][] EXPECTED_MISC = {
56+ {null , null , "ArgTem=arg1:tem" , null , null , "ArgTem=argM:tmp" , "ArgTem=arg1:tem" , null , null , null , "ArgTem=argM:loc" , "ArgTem=argM:adv" , null , null , null , null , null , "ArgTem=arg2:atr" , null , "ArgTem=arg0:agt" , null },
57+ {null , null , null , null , null },
58+ };
5559
5660 static final String [][] EXPECTED_FEATS = {
5761 {
@@ -232,11 +236,12 @@ public void testReadingInCoNLLUFile() throws ClassNotFoundException, IOException
232236 }
233237 }
234238
235- // check the features and that there are no fields currently unaccounted for
239+ // check the features, the misc columns, and that there are no fields currently unaccounted for
236240 for (int i = 0 ; i < sentences .size (); ++i ) {
237241 CoreMap sentence = sentences .get (i );
238242 List <CoreLabel > tokens = sentence .get (CoreAnnotations .TokensAnnotation .class );
239243 assertEquals (EXPECTED_FEATS [i ].length , tokens .size ());
244+ assertEquals (EXPECTED_MISC [i ].length , tokens .size ());
240245 for (int j = 0 ; j < tokens .size (); ++j ) {
241246 CoreLabel token = tokens .get (j );
242247
@@ -251,6 +256,15 @@ public void testReadingInCoNLLUFile() throws ClassNotFoundException, IOException
251256 assertEquals (expected , feats );
252257 }
253258
259+ String expectedMisc = EXPECTED_MISC [i ][j ];
260+ if (expectedMisc == null ) {
261+ assertFalse (token .containsKey (CoreAnnotations .CoNLLUMisc .class ));
262+ } else {
263+ expectedKeys += 1 ;
264+ String misc = token .get (CoreAnnotations .CoNLLUMisc .class ).toString ();
265+ assertEquals (expectedMisc , misc );
266+ }
267+
254268 // Some of the AnCora sentences don't have XPOS
255269 if (token .containsKey (CoreAnnotations .PartOfSpeechAnnotation .class )) {
256270 expectedKeys += 1 ;
0 commit comments