code: 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));
          }
      }
docs: 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.
  @param text the text to split
  @param bySpaces whether words should be split only by spaces or by punctuation like '-', '.' etc
  @return the words as a list of strings