evaluateWeightingSchemes(Parameters.WeightingMethod.TFIDF);
}
private void evaluateWeightingSchemes(WeightingMethod method) {
RAMTrainingCorpus corpus = new RAMTrainingCorpus();
learner.setMethod(method);
for (String[] content : docs) {
Document doc = learner.createDocument(content);
corpus.add(doc);
}
Iterator<Document> corpusIter = corpus.iterator();
Map<Integer, String> invertedIndex = learner.getLexicon()
.getInvertedIndex();
List<Map> expectedset = references.get(method);
// check that we have the same number of docs in the corpus
// and in the ref
assertEquals(expectedset.size(), corpus.size());
for (Map<String, Double> ref : expectedset) {
Document doc = corpusIter.next();
Vector vector = doc.getFeatureVector(learner.getLexicon());
// now let's compare what we wanted to have with the content of the