return Collections.emptyList();
}
final Map<String,Set<MetaDataHit>> namedMetaDataHits = getNamedMetaDataHits( firstTokenHits );
final List<LookupHit> lookupHits = new ArrayList<LookupHit>();
final LookupToken firstWordLookupToken = wLookupTokenList.get( firstTokenIndex );
final int firstWordStartOffset = firstWordLookupToken.getStartOffset();
final int firstWordEndOffset = firstWordLookupToken.getEndOffset();
final List<LookupToken> singleTokenList = Arrays.asList( firstWordLookupToken );
final String[] firstWordPhrases = iv_phrBuilder.getPhrases( singleTokenList );
for ( int i=0; i<firstWordPhrases.length; i++ ) {
// perform toLowerCase() here instead of in the iterations below 2-21-13 spf
firstWordPhrases[i] = firstWordPhrases[i].toLowerCase();
}
int permutationIndex = wLookupTokenList.size();
if ( firstTokenIndex < wLookupTokenList.size() && permutationIndex > 0 ) {
permutationIndex--;
}
final List<List<Integer>> permutationList = iv_permCacheMap.get( permutationIndex );
for ( List<Integer> permutations : permutationList ) {
// Moved sort and offset calculation from inner (per MetaDataHit) iteration 2-21-2013 spf
Collections.sort( permutations );
int startOffset = firstWordStartOffset;
int endOffset = firstWordEndOffset;
if ( !permutations.isEmpty() ) {
int firstIdx = permutations.get( 0 );
if ( firstIdx <= firstTokenIndex ) {
firstIdx--;
}
final LookupToken firstToken = wLookupTokenList.get( firstIdx );
if ( firstToken.getStartOffset() < firstWordStartOffset ) {
startOffset = firstToken.getStartOffset();
}
int lastIdx = permutations.get( permutations.size() - 1 );
if ( lastIdx <= firstTokenIndex ) {
lastIdx--;
}
final LookupToken lastToken = wLookupTokenList.get( lastIdx );
if ( lastToken.getEndOffset() > firstWordEndOffset ) {
endOffset = lastToken.getEndOffset();
}
}
// convert permutation idx back into LookupTokens
final List<LookupToken> tempLookupTokens = new ArrayList<LookupToken>();
for ( Integer idx : permutations ) {
if ( idx <= firstTokenIndex ) {
idx--;
}
final LookupToken lookupToken = wLookupTokenList.get( idx );
tempLookupTokens.add( lookupToken );
}
final String[] lookupTokenPhrases = iv_phrBuilder.getPhrases( tempLookupTokens );
for ( String lookupTokenPhrase : lookupTokenPhrases ) {
// perform toLowerCase() here instead of repeating in each inner loop