public final String getTargetPosTag ( ) { String targetPosTag = match . getPosTag ( ) ; List < String > posTags = new ArrayList <> ( ) ; Pattern pPosRegexMatch = match . getPosRegexMatch ( ) ; String posTagReplace = match . getPosTagReplace ( ) ; if ( match . isStaticLemma ( ) ) { for ( AnalyzedToken analyzedToken : matchedToken ) { String tst = analyzedToken . getPOSTag ( ) ; if ( tst != null && pPosRegexMatch . matcher ( tst ) . matches ( ) ) { targetPosTag = analyzedToken . getPOSTag ( ) ; posTags . add ( targetPosTag ) ; } } if ( pPosRegexMatch != null && posTagReplace != null && ! posTags . isEmpty ( ) ) { targetPosTag = pPosRegexMatch . matcher ( targetPosTag ) . replaceAll ( posTagReplace ) ; } } else { for ( AnalyzedToken analyzedToken : formattedToken ) { String tst = analyzedToken . getPOSTag ( ) ; if ( tst != null && pPosRegexMatch . matcher ( tst ) . matches ( ) ) { targetPosTag = analyzedToken . getPOSTag ( ) ; posTags . add ( targetPosTag ) ; } } if ( pPosRegexMatch != null && posTagReplace != null ) { if ( posTags . isEmpty ( ) ) { posTags . add ( targetPosTag ) ; } StringBuilder sb = new StringBuilder ( ) ; int posTagLen = posTags . size ( ) ; int l = 0 ; for ( String lPosTag : posTags ) { l ++ ; lPosTag = pPosRegexMatch . matcher ( lPosTag ) . replaceAll ( posTagReplace ) ; if ( match . setsPos ( ) ) { lPosTag = synthesizer . getPosTagCorrection ( lPosTag ) ; } sb . append ( lPosTag ) ; if ( l < posTagLen ) { sb . append ( ' ' ) ; } } targetPosTag = sb . toString ( ) ; } } return targetPosTag ; }
on the other hand many POS tags = too many suggestions?