ClausIEAnnotator extends Annotator { @Override protected void addView(TextAnnotation ta) throws AnnotatorException { assert ta.hasView(ViewNames.SENTENCE): "Sentences view didn't find . . . "; List<Constituent> sentences = ta.getView(ViewNames.SENTENCE).getConstituents(); View vu = new View(viewName, "ClausIEAnnotator", ta, 1.0); assert sentences.size() == ta.getNumberOfSentences(); for(Constituent sent : sentences) { String[] clausieResults = ClausieSplitter.split(sent.getSurfaceForm()); Constituent sentenceCons = new Constituent("sent-" + sent.getSentenceId(), viewName, ta, sent.getStartSpan(), sent.getEndSpan()); int propId = 0; for(String clausieSent : clausieResults) { sentenceCons.addAttribute("clauseIe:" + propId, clausieSent); propId++; } vu.addConstituent(sentenceCons); } ta.addView(viewName, vu); } ClausIEAnnotator(); @Override void initialize(ResourceManager rm);  }
@Ignore @Test public void testAnnotator() throws AnnotatorException { TextAnnotation ta = DummyTextAnnotationGenerator. generateAnnotatedTextAnnotation(false, 3); ClausIEAnnotator annotator = new ClausIEAnnotator(); ta.addView(annotator); assertTrue(ta.hasView(annotator.getViewName())); }