NGram extends MapTransformer<NGram> implements NGramParams <NGram> { public NGram() { this(null); } NGram();  NGram(Params params);   }
@Test public void testNGram() throws Exception { Row[] rows = new Row[] { Row.of(0, "a a b b c c a") }; Table data = MLEnvironmentFactory.getDefault().createBatchTable(rows, new String[] {"id", "sentence"}); Table dataStream = MLEnvironmentFactory.getDefault().createStreamTable(rows, new String[] {"id", "sentence"}); NGram op = new NGram() .setSelectedCol("sentence"); Table res = op.transform(data); List <String> list = MLEnvironmentFactory.getDefault().getBatchTableEnvironment().toDataSet(res.select("sentence"), String.class) .collect(); Assert.assertArrayEquals(list.toArray(new String[0]), new String[] {"a_a a_b b_b b_c c_c c_a"}); res = op.transform(dataStream); DataStreamConversionUtil.fromTable(MLEnvironmentFactory.DEFAULT_ML_ENVIRONMENT_ID,res).print(); MLEnvironmentFactory.getDefault().getStreamExecutionEnvironment().execute(); }