@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(); } } } }
protected void annotateSentence(JCas jcas, Sentence sent) throws AnalysisEngineProcessException{ List<Chunk> chunkList = new ArrayList<>(JCasUtil.selectCovered(jcas, Chunk.class, sent)); // For each chunk in the Sentence, see if the chunk is the start of a // matching pattern // If so, extend the end offset of the <code>i</code> + // <code>indexOfTokenToInclude</code> for (int i = 0; i < chunkList.size(); i++) { boolean matches = true; Chunk chunk = chunkList.get(i); while (matches == true) { matches = compareToPattern(chunkList, i); if (matches) { extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude) .getEnd()); removeEnvelopedChunks(chunkList, i); // to check again on next // iteration of while loop } } } }
protected void annotateSentence(JCas jcas, Sentence sent) throws AnalysisEngineProcessException{ List<Chunk> chunkList = new ArrayList<>(JCasUtil.selectCovered(jcas, Chunk.class, sent)); // For each chunk in the Sentence, see if the chunk is the start of a // matching pattern // If so, extend the end offset of the <code>i</code> + // <code>indexOfTokenToInclude</code> for (int i = 0; i < chunkList.size(); i++) { boolean matches = true; Chunk chunk = chunkList.get(i); while (matches == true) { matches = compareToPattern(chunkList, i); if (matches) { extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude) .getEnd()); removeEnvelopedChunks(chunkList, i); // to check again on next // iteration of while loop } } } }
/** * A utility method that annotates a given range. */ protected void annotateRange(JCas jcas, int rangeBegin, int rangeEnd) throws AnalysisEngineProcessException { // logger.info("Adjuster: from " + rangeBegin + " to " + rangeEnd); // Find the Chunks in this Sentence // For each Chunk, there is a corresponding more specific such as NP, // PP, etc List<Chunk> chunkList = new ArrayList<>(JCasUtil.selectCovered(jcas, Chunk.class, rangeBegin, rangeEnd)); // For each chunk in the Sentence, see if the chunk is the start of a // matching pattern // If so, extend the end offset of the <code>i</code> + // <code>indexOfTokenToInclude</code> for (int i = 0; i < chunkList.size(); i++) { boolean matches = true; Chunk chunk = chunkList.get(i); while (matches == true) { matches = compareToPattern(chunkList, i); if (matches) { extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude) .getEnd()); removeEnvelopedChunks(chunkList, i); // to check again on next // iteration of while loop } } } }
/** * A utility method that annotates a given range. */ protected void annotateRange(JCas jcas, int rangeBegin, int rangeEnd) throws AnalysisEngineProcessException { // logger.info("Adjuster: from " + rangeBegin + " to " + rangeEnd); // Find the Chunks in this Sentence // For each Chunk, there is a corresponding more specific such as NP, // PP, etc List<Chunk> chunkList = new ArrayList<>(JCasUtil.selectCovered(jcas, Chunk.class, rangeBegin, rangeEnd)); // For each chunk in the Sentence, see if the chunk is the start of a // matching pattern // If so, extend the end offset of the <code>i</code> + // <code>indexOfTokenToInclude</code> for (int i = 0; i < chunkList.size(); i++) { boolean matches = true; Chunk chunk = chunkList.get(i); while (matches == true) { matches = compareToPattern(chunkList, i); if (matches) { extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude) .getEnd()); removeEnvelopedChunks(chunkList, i); // to check again on next // iteration of while loop } } } }
@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(); }
break; } else { if ( chunk.getEnd() < arg.getEnd() ) { continue; } else if ( !DependencyUtility.equalCoverage(
break; if ( chunk.getEnd() < arg.getEnd() ) { continue; } else if ( !DependencyUtility.equalCoverage(
break; } else { if ( chunk.getEnd()<arg.getEnd()) { continue; } else if ( !DependencyUtility.equalCoverage(
break; if ( chunk.getEnd()<arg.getEnd()) { continue; } else if ( !DependencyUtility.equalCoverage(
break; } else { if ( chunk.getEnd()<arg.getEnd()) { continue; } else if ( !DependencyUtility.equalCoverage(
break; if ( chunk.getEnd()<arg.getEnd()) { continue; } else if ( !DependencyUtility.equalCoverage(