public static String [ ] textToWordSequence ( String text , String filters , boolean lower , String split ) { if ( lower ) text = text . toLowerCase ( ) ; for ( String filter : filters . split ( "" ) ) { text = text . replace ( filter , split ) ; } String [ ] sequences = text . split ( split ) ; List < String > seqList = new ArrayList ( Arrays . asList ( sequences ) ) ; seqList . removeAll ( Arrays . asList ( "" , null ) ) ; return seqList . toArray ( new String [ seqList . size ( ) ] ) ; }
Turns a String text into a sequence of tokens .