private static List < String > getWords ( String text , boolean bySpaces ) { if ( bySpaces ) { List < String > words = new ArrayList <> ( ) ; for ( String split : text . split ( "\\s+" ) ) { if ( StringUtils . isNotEmpty ( split ) ) { words . add ( split ) ; } } return words ; } else { return Arrays . asList ( ExpressionUtils . tokenize ( text ) ) ; } }
Helper function which splits the given text string into words . If by_spaces is false then text like 01 - 02 - 2014 will be split into 3 separate words . For backwards compatibility this is the default for all expression functions .