}
@Test
public void test1() {
List<Range> ranges = getRanges(0,2, 2,3, 5,1);
SpanExtraction extr =
new SpanExtraction(sent, ranges);
assertEquals(3, extr.getNumFields());
assertEquals("John Smith", extr.getField(0).toString());
assertEquals("John Smith", extr.getField("field0").toString());
assertEquals("was born in", extr.getField(1).toString());
assertEquals("was born in", extr.getField("field1").toString());
assertEquals("Detroit", extr.getField(2).toString());
assertEquals("Detroit", extr.getField("field2").toString());
List<String> fieldNames = new ArrayList<String>(3);
fieldNames.add("arg1");
fieldNames.add("rel");
fieldNames.add("arg2");
extr = new SpanExtraction(sent, ranges, fieldNames);
assertEquals("John Smith", extr.getField("arg1").toString());
assertEquals("was born in", extr.getField("rel").toString());
assertEquals("Detroit", extr.getField("arg2").toString());
}