public virtual void Inform(IResourceLoader loader)
{
Stream stream = null;
try
{
if (dictFile != null) // the dictionary can be empty.
{
dictionary = GetWordSet(loader, dictFile, false);
}
// TODO: Broken, because we cannot resolve real system id
// ResourceLoader should also supply method like ClassLoader to get resource URL
stream = loader.OpenResource(hypFile);
//InputSource @is = new InputSource(stream);
//@is.Encoding = encoding; // if it's null let xml parser decide
//@is.SystemId = hypFile;
var xmlEncoding = string.IsNullOrEmpty(encoding) ? Encoding.UTF8 : Encoding.GetEncoding(encoding);
hyphenator = HyphenationCompoundWordTokenFilter.GetHyphenationTree(stream, xmlEncoding);
}
finally
{
IOUtils.CloseWhileHandlingException(stream);
}
}