
package org.languagetool.tagging.disambiguation.pl;

import java.io.IOException;

import org.languagetool.AnalyzedSentence;
import org.languagetool.language.Polish;
import org.languagetool.tagging.disambiguation.AbstractDisambiguator;
import org.languagetool.tagging.disambiguation.Disambiguator;
import org.languagetool.tagging.disambiguation.MultiWordChunker;
import org.languagetool.tagging.disambiguation.rules.XmlRuleDisambiguator;

/**
 * Hybrid chunker-disambiguator for Polish.
 * 
 * @author Marcin Miłkowski
 */

public class PolishHybridDisambiguator extends AbstractDisambiguator {

  private final Disambiguator chunker = new MultiWordChunker("/pl/multiwords.txt");
  private final Disambiguator disambiguator = new XmlRuleDisambiguator(new Polish());

  /**
   * Calls two disambiguator classes: (1) a chunker; (2) a rule-based
   * disambiguator.
   */
  @Override
  public final AnalyzedSentence disambiguate(AnalyzedSentence input)
      throws IOException {
    return chunker.disambiguate(disambiguator.disambiguate(input));
  }

}
