TextValueEncoder enc = new TextValueEncoder("text");
Vector v1 = new DenseVector(200);
enc.addToVector("test1 and more", v1);
enc.flush(1, v1);
// should set 6 distinct locations to 1
assertEquals(6.0, v1.norm(1), 0);
assertEquals(1.0, v1.maxValue(), 0);
// now some fancy weighting
StaticWordValueEncoder w = new StaticWordValueEncoder("text");
w.setDictionary(ImmutableMap.<String, Double>of("word1", 3.0, "word2", 1.5));