private Appendable normalize ( CharSequence src , Appendable dest , UnicodeSet . SpanCondition spanCondition ) { // Don't throw away destination buffer between iterations. StringBuilder tempDest = new StringBuilder ( ) ; try { for ( int prevSpanLimit = 0 ; prevSpanLimit < src . length ( ) ; ) { int spanLimit = set . span ( src , prevSpanLimit , spanCondition ) ; int spanLength = spanLimit - prevSpanLimit ; if ( spanCondition == UnicodeSet . SpanCondition . NOT_CONTAINED ) { if ( spanLength != 0 ) { dest . append ( src , prevSpanLimit , spanLimit ) ; } spanCondition = UnicodeSet . SpanCondition . SIMPLE ; } else { if ( spanLength != 0 ) { // Not norm2.normalizeSecondAndAppend() because we do not want // to modify the non-filter part of dest. dest . append ( norm2 . normalize ( src . subSequence ( prevSpanLimit , spanLimit ) , tempDest ) ) ; } spanCondition = UnicodeSet . SpanCondition . NOT_CONTAINED ; } prevSpanLimit = spanLimit ; } } catch ( IOException e ) { throw new ICUUncheckedIOException ( e ) ; } return dest ; }
an in - filter prefix .