public static ParagraphDisambiguatorJ getDisambiguator(String name) throws InputException {
DisambiguationPolicy policy = DisambiguationPolicy.Default;
try {
policy = DisambiguationPolicy.valueOf(name);
} catch (IllegalArgumentException e) {
throw new InputException(String.format("Specified parameter disambiguator=%s is invalid. Use one of %s.",name,DisambiguationPolicy.values()));
}
if (disambiguators.size() == 0)
throw new InputException(String.format("No disambiguators were loaded. Please add one of %s.",disambiguators.keySet()));
ParagraphDisambiguatorJ disambiguator = disambiguators.get(policy);
if (disambiguator == null)
throw new InputException(String.format("Specified disambiguator=%s has not been loaded. Use one of %s.",name,disambiguators.keySet()));
return disambiguator;
}