Examples of SpannedRareWordTerm


Examples of org.apache.ctakes.dictionary.lookup2.term.SpannedRareWordTerm

            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 ) );
            }
         }
      }
   }
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup2.term.SpannedRareWordTerm

            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 SpannedRareWordTerm overlapTerm = getOverlapTerm( allTokens, lookupTokenIndex, rareWordHit,
                                                                    _consecutiveSkipMax, _totalSkipMax );
            if ( overlapTerm != null ) {
               termsFromDictionary.add( overlapTerm );
            }
         }
View Full Code Here

Examples of org.apache.ctakes.dictionary.lookup2.term.SpannedRareWordTerm

         if ( lastWordIndex == -1 ) {
            return null;
         }
      }
      if ( missingSpanKeys.isEmpty() ) {
         return new SpannedRareWordTerm( rareWordHit,
                                         allTokens.get( firstWordIndex ).getStart(),
                                         allTokens.get( lastWordIndex ).getEnd() );
      }
      final TextSpan discontiguousSpanKey = new MultiTextSpan( allTokens.get( firstWordIndex ).getStart(),
                                                                     allTokens.get( lastWordIndex ).getEnd(),
                                                                     missingSpanKeys );
      return new SpannedRareWordTerm( rareWordHit, discontiguousSpanKey );
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.