private static List<String> crossCatenate(List<List<String>> allWordsList){
  List<String> crossList=new ArrayList<String>(allWordsList.get(0));
  for (  List<String> wordList : allWordsList.subList(1,allWordsList.size())) {
    int priorCrossListLength=crossList.size();
    crossList=replicate(crossList,wordList.size());
    for (int i=0; i < wordList.size(); i++) {
      for (int j=0; j < priorCrossListLength; j++) {
        int index=i * priorCrossListLength + j;
        crossList.set(index,crossList.get(index) + " " + wordList.get(i));
      }
    }
  }
  return crossList;
}

private static List < String > crossCatenate ( List < List < String > > allWordsList ) { List < String > crossList = new ArrayList < String > ( allWordsList . get ( 0 ) ) ; for ( List < String > wordList : allWordsList . subList ( 1 , allWordsList . size ( ) ) ) { int priorCrossListLength = crossList . size ( ) ; crossList = replicate ( crossList , wordList . size ( ) ) ; for ( int i = 0 ; i < wordList . size ( ) ; i ++ ) { for ( int j = 0 ; j < priorCrossListLength ; j ++ ) { int index = i * priorCrossListLength + j ; crossList . set ( index , crossList . get ( index ) + " " + wordList . get ( i ) ) ; } } } return crossList ; }
function to perform a cross product concatenation of separate rewritten term lists for example if there are k lists : < l1 > , < l2 > , < l3 > , . . . , < lk > function creates a combined list < l > containing all possible k - combinations where each combination contains an entry from each of the k lists combinations maintain order in which terms were parsed
