private String computeMorse ( BytesRef term ) { StringBuilder stringBuilder = new StringBuilder ( ) ; int i = term . offset + prefixOffset ; for ( ; i < term . length ; i ++ ) { if ( ALPHABET_MORSE . containsKey ( term . bytes [ i ] ) ) { stringBuilder . append ( ALPHABET_MORSE . get ( term . bytes [ i ] ) + " " ) ; } else if ( term . bytes [ i ] != 0x00 ) { return null ; } else { break ; } } return stringBuilder . toString ( ) ; }
Compute morse .