public static String phrase ( int minSize , int maxSize ) { maxSize = Math . max ( minSize , maxSize ) ; int size = RandomInteger . nextInteger ( minSize , maxSize ) ; if ( size <= 0 ) return "" ; StringBuilder result = new StringBuilder ( ) ; result . append ( RandomString . pick ( _allWords ) ) ; while ( result . length ( ) < size ) { result . append ( " " ) . append ( RandomString . pick ( _allWords ) . toLowerCase ( ) ) ; } return result . toString ( ) ; }
Generates a random phrase which consists of few words separated by spaces . The first word is capitalized others are not .