public static List<Window> windows(String words,TokenizerFactory tokenizerFactory,int windowSize){
  Tokenizer tokenizer=tokenizerFactory.create(words);
  List<String> list=new ArrayList<>();
  while (tokenizer.hasMoreTokens())   list.add(tokenizer.nextToken());
  if (list.isEmpty())   throw new IllegalStateException("No tokens found for windows");
  return windows(list,windowSize);
}

public static List < Window > windows ( String words , TokenizerFactory tokenizerFactory , int windowSize ) { Tokenizer tokenizer = tokenizerFactory . create ( words ) ; List < String > list = new ArrayList < > ( ) ; while ( tokenizer . hasMoreTokens ( ) ) list . add ( tokenizer . nextToken ( ) ) ; if ( list . isEmpty ( ) ) throw new IllegalStateException ( "No tokens found for windows" ) ; return windows ( list , windowSize ) ; }
constructs a list of window of size windowsize . note that padding for each window is created as well .
