A method in BayesianClassifier calls the method below (a method of Category):
public void updateProbabilities(Map<String, int> woordfrequenties) {
for (Map.Entry<String, int> woordfrequentie : woordfrequenties.entrySet()) {
String woord = woordfrequentie.getKey();
int frequentie = woordfrequentie.getValue();
int index = BayesianClassifier.getVocabulary().indexOf(woord);
}
}
Now, it states that the non-static method getVocabulary from BayesianClassifier cannot be referenced from the static context here, which I understand, but how then can the method get the value of field 'vocabulary' from the instance of BayesianClassifier that calls this method? It surely must be possible without passing the whole vocabulary as a parameter, or giving the class Category the instance of BayesianClassifier as a field?