@Test public void testQuantityPeople() throws Exception { jCas.setDocumentText("47,000 people voted in an independence referendum"); Quantity n = new Quantity(jCas, 0, 6); n.addToIndexes(); processJCas(); assertEquals(0, JCasUtil.select(jCas, Quantity.class).size()); assertEquals(1, JCasUtil.select(jCas, Organisation.class).size()); assertEquals( "47,000 people", JCasUtil.selectByIndex(jCas, Organisation.class, 0).getCoveredText()); }
private void quantityPeople(JCas jCas) { List<Quantity> toRemove = new ArrayList<>(); for (Quantity quant : JCasUtil.select(jCas, Quantity.class)) { String followingText = jCas.getDocumentText().substring(quant.getEnd()).toLowerCase(); if (followingText.startsWith(" people")) { Organisation o = new Organisation(jCas, quant.getBegin(), quant.getEnd() + 7); addToJCasIndex(o); if (removeOriginal) toRemove.add(quant); } } removeFromJCasIndex(toRemove); }
People extends BaleenAnnotator { private void quantityPeople(JCas jCas) { List<Quantity> toRemove = new ArrayList<>(); for (Quantity quant : JCasUtil.select(jCas, Quantity.class)) { String followingText = jCas.getDocumentText().substring(quant.getEnd()).toLowerCase(); if (followingText.startsWith(" people")) { Organisation o = new Organisation(jCas, quant.getBegin(), quant.getEnd() + 7); addToJCasIndex(o); if (removeOriginal) toRemove.add(quant); } } removeFromJCasIndex(toRemove); } }
People extends BaleenAnnotator { private void quantityPeople(JCas jCas) { List<Quantity> toRemove = new ArrayList<>(); for (Quantity quant : JCasUtil.select(jCas, Quantity.class)) { String followingText = jCas.getDocumentText().substring(quant.getEnd()).toLowerCase(); if (followingText.startsWith(" people")) { Organisation o = new Organisation(jCas, quant.getBegin(), quant.getEnd() + 7); addToJCasIndex(o); if (removeOriginal) toRemove.add(quant); } } removeFromJCasIndex(toRemove); }  }
People extends BaleenAnnotator { private void quantityPeople(JCas jCas) { List<Quantity> toRemove = new ArrayList<>(); for (Quantity quant : JCasUtil.select(jCas, Quantity.class)) { String followingText = jCas.getDocumentText().substring(quant.getEnd()).toLowerCase(); if (followingText.startsWith(" people")) { Organisation o = new Organisation(jCas, quant.getBegin(), quant.getEnd() + 7); addToJCasIndex(o); if (removeOriginal) toRemove.add(quant); } } removeFromJCasIndex(toRemove); }  @Override AnalysisEngineAction getAction(); }
People extends BaleenAnnotator { private void quantityPeople(JCas jCas) { List<Quantity> toRemove = new ArrayList<>(); for (Quantity quant : JCasUtil.select(jCas, Quantity.class)) { String followingText = jCas.getDocumentText().substring(quant.getEnd()).toLowerCase(); if (followingText.startsWith(" people")) { Organisation o = new Organisation(jCas, quant.getBegin(), quant.getEnd() + 7); addToJCasIndex(o); if (removeOriginal) toRemove.add(quant); } } removeFromJCasIndex(toRemove); }  @Override AnalysisEngineAction getAction(); static final String PARAM_REMOVE_ORIGINAL; }