public Collection<WordOccurences> getAllTerms() {
        try {
            List<String> terms = myStem.lemmatize(path);
            Map<String, WordOccurences> occurences = new HashMap<>();
            for (int i = 0; i < terms.size(); ++i) {
                String term = terms.get(i);
                if (occurences.containsKey(term)) {
                    occurences.get(term).add(i);
                } else {
                    occurences.put(term, new WordOccurences(term, path.toString()));
                    occurences.get(term).add(i);
                }
            }

            return occurences.values();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }