BratTextAnnotation extends BratAnnotation { public static BratTextAnnotation parse(String aLine) { Matcher m = PATTERN.matcher(aLine); if (!m.matches()) { throw new IllegalArgumentException("Illegal text annotation format [" + aLine + "]"); } List<Offsets> offsetsLocal = generateOffsetsString(m.group(OFFSETS)); String[] textsLocal = splitText(m.group(TEXT), offsetsLocal); return new BratTextAnnotation(m.group(ID), m.group(TYPE), offsetsLocal, textsLocal); } BratTextAnnotation(int aId, String aType, List<Offsets> aOffsets, String[] aTexts);  BratTextAnnotation(String aId, String aType, List<Offsets> aOffsets, String[] aTexts); List<Offsets> getOffsets(); String[] getText(); @Override void write(JsonGenerator aJG); @Override String toString(); static BratTextAnnotation parse(String aLine);  }
@Test public void parseTest() { final String in = "T1\tOrganization 0 43\tInternational Business Machines Corporation"; BratTextAnnotation v = BratTextAnnotation.parse(in); assertEquals(in, v.toString()); }