ConstantValueEncoder extends CachingValueEncoder { @Override public String asString(String originalForm) { return getName(); } ConstantValueEncoder(String name); @Override void addToVector(byte[] originalForm, double weight, Vector data); @Override String asString(String originalForm);  }
@Test public void testAsString() { FeatureVectorEncoder enc = new ConstantValueEncoder("foo"); assertEquals("foo", enc.asString("123")); }