@Override
public AnalyzedSentence disambiguate(AnalyzedSentence input) throws IOException {
AnalyzedSentence sentence = input;
String filePath = "/disambiguator.xml";
try (InputStream inputStream = getClass().getResourceAsStream(filePath)) {
final DisambiguationRuleLoader ruleLoader = new DisambiguationRuleLoader();
List<DisambiguationPatternRule> disambiguationRules = ruleLoader.getRules(inputStream);
for (final DisambiguationPatternRule patternRule : disambiguationRules) {
sentence = patternRule.replace(sentence);
}
} catch (Exception e) {
throw new RuntimeException("Problems with loading disambiguation file: " + filePath, e);