docs: public static ArrayList<String> ngram(String[] strs, int[] grams) {
          ArrayList<String> list = new ArrayList<String>();
          StringBuffer buf = new StringBuffer();
          for (int j = 0; j < grams.length; j++) {
              int len = grams[j];
              if (len <= 0 || len > strs.length)
                  continue;
              for (int i = 0; i < strs.length - len+1; i++) {
                  buf.delete(0, buf.length());
                  int k = 0;
                  for(; k < len-1; ++k)   {
                      buf.append(strs[i+k]);
                      buf.append(' ');
                  }
                  buf.append(strs[i+k]);
                  list.add(buf.toString().intern());
              }
          }
          return list;
      }