}
public void test() throws InvalidDatastoreException {
ClassifierContext classifier = new ClassifierContext(algorithm, store);
String[] document = { "aa", "ff" };
ClassifierResult result = classifier.classifyDocument(document, "unknown");
assertNotNull("category is null and it shouldn't be", result);
assertEquals(result + " is not equal to e", "e", result.getLabel());
document = new String[] { "ff" };
result = classifier.classifyDocument(document, "unknown");
assertNotNull("category is null and it shouldn't be", result);
assertEquals(result + " is not equal to d", "d", result.getLabel());// GSI:
// was
// unknown,
// but
// we
// now
// just
// pick
// the
// first
// cat
document = new String[] { "cc" };
result = classifier.classifyDocument(document, "unknown");
assertNotNull("category is null and it shouldn't be", result);
assertEquals(result + " is not equal to d", "d", result.getLabel());
}