public static List<String> getWords(final String text, final int wordMinimumLength) {

    List<String> allWords = newArrayList();
    if (text == null) {
      return allWords;
    }
    Matcher matcher = matchText(text);
    for (; matcher.find();) {
      String word = matcher.group(0);
      if (wordMinimumLength < 2) {
        allWords.add(word);
      } else {
        if (word.length() >= wordMinimumLength) {
          allWords.add(word);
        }
      }
    }
    return allWords;
  }
public static List < String > getWords ( final String text , final int wordMinimumLength ) { List < String > allWords = newArrayList ( ) ; if ( text == null ) { return allWords ; } Matcher matcher = matchText ( text ) ; for ( ; matcher . find ( ) ; ) { String word = matcher . group ( 0 ) ; if ( wordMinimumLength < 2 ) { allWords . add ( word ) ; } else { if ( word . length ( ) >= wordMinimumLength ) { allWords . add ( word ) ; } } } return allWords ; }
Returns words in given text by given word minimum length.<br>
<p>
e.g: <br>
text: "I have a dream, but now it is only a dream."<br>
wordMinimumLength: 2 <br>
result:["have","dream","but","now","it","is","only","dream"].<br>
<p>
NB. "1word","word1" also were words.

@param text source string to be handled.
@param wordMinimumLength word minimum length to partition.
@return words in given text by given word minimum length.