/** * Update the end value for the chunk to have the new value * * @param chunk * The chunk to update * @param newEnd * The new end value for the chunk. * @return The updated Chunk * @throws AnnotatorProcessException */ private static Chunk extendChunk(Chunk chunk, int newEnd) throws AnalysisEngineProcessException { if (newEnd < chunk.getBegin()) { Exception e; e = new Exception("New end offset (" + newEnd + ") < begin offset (" + chunk.getBegin() + ")."); throw new AnalysisEngineProcessException(e); } // logger.info("Extending chunk end from " +chunk.getEnd()+ " to " + // newEnd + "."); // logger.info("For chunk " + chunk.getChunkType()); // logger.info(" text = '" + chunk.getCoveredText() + "'."); chunk.setEnd(newEnd); // logger.info(" new text = '" + chunk.getCoveredText() + "'."); return chunk; }
/** * Update the end value for the chunk to have the new value * * @param chunk * The chunk to update * @param newEnd * The new end value for the chunk. * @return The updated Chunk * @throws AnnotatorProcessException */ private static Chunk extendChunk(Chunk chunk, int newEnd) throws AnalysisEngineProcessException { if (newEnd < chunk.getBegin()) { Exception e; e = new Exception("New end offset (" + newEnd + ") < begin offset (" + chunk.getBegin() + ")."); throw new AnalysisEngineProcessException(e); } // logger.info("Extending chunk end from " +chunk.getEnd()+ " to " + // newEnd + "."); // logger.info("For chunk " + chunk.getChunkType()); // logger.info(" text = '" + chunk.getCoveredText() + "'."); chunk.setEnd(newEnd); // logger.info(" new text = '" + chunk.getCoveredText() + "'."); return chunk; }
@Override public void process( JCas jCas ) throws AnalysisEngineProcessException { for ( Chunk chunk : JCasUtil.select( jCas, Chunk.class ) ) { if ( chunk.getChunkType().equals( "NP" ) ) { new LookupWindowAnnotation( jCas, chunk.getBegin(), chunk.getEnd() ).addToIndexes(); } } } }
@Override public void process( JCas jCas ) throws AnalysisEngineProcessException { for ( Chunk chunk : JCasUtil.select( jCas, Chunk.class ) ) { if ( chunk.getChunkType().equals( "NP" ) ) { new LookupWindowAnnotation( jCas, chunk.getBegin(), chunk.getEnd() ).addToIndexes(); } } } }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { ArrayList<Annotation> la = AnnotationSelector.selectNE(aJCas); for (int i = 0; i < la.size(); ++i) { Annotation a = la.get(i); NEMarkable m = new NEMarkable(aJCas, a.getBegin(), a.getEnd()); m.setContent(a); m.setId(nextID + i); m.addToIndexes(); } nextID += la.size(); ArrayList<WordToken> lw = AnnotationSelector.selectPronoun(aJCas, modalAdj, cogved, otherVerb, logger); for (int i = 0; i < lw.size(); ++i) { WordToken t = lw.get(i); PronounMarkable m = new PronounMarkable(aJCas, t.getBegin(), t.getEnd()); m.setContent(t); m.setId(nextID + i); m.addToIndexes(); } nextID += lw.size(); ArrayList<Chunk> lc = AnnotationSelector.selectDemonAndRelative(aJCas); for (int i = 0; i < lc.size(); ++i) { Chunk c = lc.get(i); DemMarkable m = new DemMarkable(aJCas, c.getBegin(), c.getEnd()); m.setContent(c); m.setId(nextID + i); m.addToIndexes(); } nextID += lc.size(); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { ArrayList<Annotation> la = AnnotationSelector.selectNE(aJCas); for (int i = 0; i < la.size(); ++i) { Annotation a = la.get(i); NEMarkable m = new NEMarkable(aJCas, a.getBegin(), a.getEnd()); m.setContent(a); m.setId(nextID + i); m.addToIndexes(); } nextID += la.size(); ArrayList<WordToken> lw = AnnotationSelector.selectPronoun(aJCas, modalAdj, cogved, otherVerb, logger); for (int i = 0; i < lw.size(); ++i) { WordToken t = lw.get(i); PronounMarkable m = new PronounMarkable(aJCas, t.getBegin(), t.getEnd()); m.setContent(t); m.setId(nextID + i); m.addToIndexes(); } nextID += lw.size(); ArrayList<Chunk> lc = AnnotationSelector.selectDemonAndRelative(aJCas); for (int i = 0; i < lc.size(); ++i) { Chunk c = lc.get(i); DemMarkable m = new DemMarkable(aJCas, c.getBegin(), c.getEnd()); m.setContent(c); m.setId(nextID + i); m.addToIndexes(); } nextID += lc.size(); }
lschunks.addAll( JCasUtil.selectFollowing( jCas, Chunk.class, arg, 5 ) ); for ( Chunk chunk : lschunks ) { if ( chunk.getBegin() > arg.getBegin() ) { break; } else {
lschunks.addAll( JCasUtil.selectFollowing( jCas, Chunk.class, arg, 5 ) ); for ( Chunk chunk : lschunks ) { if ( chunk.getBegin() > arg.getBegin() ) { break;
lschunks.addAll(JCasUtil.selectFollowing(jCas, Chunk.class, arg, 5)); for (Chunk chunk : lschunks) { if ( chunk.getBegin()>arg.getBegin()) { break; } else {
lschunks.addAll(JCasUtil.selectFollowing(jCas, Chunk.class, arg, 5)); for (Chunk chunk : lschunks) { if ( chunk.getBegin()>arg.getBegin()) { break;
lschunks.addAll(JCasUtil.selectFollowing(jCas, Chunk.class, arg, 5)); for (Chunk chunk : lschunks) { if ( chunk.getBegin()>arg.getBegin()) { break; } else {
lschunks.addAll(JCasUtil.selectFollowing(jCas, Chunk.class, arg, 5)); for (Chunk chunk : lschunks) { if ( chunk.getBegin()>arg.getBegin()) { break;