public static List < String > tokensToJavaStringList ( Seq < KoreanToken > tokens , boolean keepSpace ) { Iterator < KoreanToken > tokenized = tokens . iterator ( ) ; List < String > output = new LinkedList <> ( ) ; while ( tokenized . hasNext ( ) ) { final KoreanToken token = tokenized . next ( ) ; if ( keepSpace || token . pos ( ) != KoreanPos . Space ( ) ) { output . add ( token . text ( ) ) ; } } return output ; }
Tokenize with the builder options into a String Iterable .