@ Nullable public final AnalyzedTokenReadings [ ] getUnifiedTokens ( ) { if ( tokSequence . isEmpty ( ) ) { return null ; } List < AnalyzedTokenReadings > uTokens = new ArrayList <> ( ) ; for ( int j = 0 ; j < tokSequence . size ( ) ; j ++ ) { boolean unifiedTokensFound = false ; // assume that nothing has been found for ( int i = 0 ; i < tokSequenceEquivalences . get ( j ) . size ( ) ; i ++ ) { int featUnified = 0 ; if ( tokSequenceEquivalences . get ( j ) . get ( i ) . containsKey ( UNIFY_IGNORE ) ) { addTokenToSequence ( uTokens , tokSequence . get ( j ) . getAnalyzedToken ( i ) , j ) ; unifiedTokensFound = true ; } else { for ( Map . Entry < String , List < String > > feat : unificationFeats . entrySet ( ) ) { if ( tokSequenceEquivalences . get ( j ) . get ( i ) . containsKey ( feat . getKey ( ) ) && tokSequenceEquivalences . get ( j ) . get ( i ) . get ( feat . getKey ( ) ) . isEmpty ( ) ) { featUnified = 0 ; } else { featUnified ++ ; } if ( featUnified == unificationFeats . entrySet ( ) . size ( ) ) { addTokenToSequence ( uTokens , tokSequence . get ( j ) . getAnalyzedToken ( i ) , j ) ; unifiedTokensFound = true ; } } } } if ( ! unifiedTokensFound ) { return null ; } } return uTokens . toArray ( new AnalyzedTokenReadings [ 0 ] ) ; }
Gets a full sequence of filtered tokens .