continue;
}
for ( RareWordTerm rareWordHit : rareWordHits ) {
if ( rareWordHit.getTokenCount() == 1 ) {
// Single word term, add and move on
termsFromDictionary.add( new SpannedRareWordTerm( rareWordHit, lookupToken.getTextSpan() ) );
continue;
}
final int termStartIndex = lookupTokenIndex - rareWordHit.getRareWordIndex();
if ( termStartIndex < 0 || termStartIndex + rareWordHit.getTokenCount() > allTokens.size() ) {
// term will extend beyond window
continue;
}
final int termEndIndex = termStartIndex + rareWordHit.getTokenCount() - 1;
if ( TokenMatchUtil.isTermMatch( rareWordHit, allTokens, termStartIndex, termEndIndex ) ) {
final int spanStart = allTokens.get( termStartIndex ).getStart();
final int spanEnd = allTokens.get( termEndIndex ).getEnd();
termsFromDictionary.add( new SpannedRareWordTerm( rareWordHit, spanStart, spanEnd ) );
}
}
}
}