// TODO: this should use inputstreams from the loader, not File!
public virtual void Inform(IResourceLoader loader)
{
if (mapping != null)
{
IList<string> wlist = null;
if (File.Exists(mapping))
{
wlist = new List<string>(GetLines(loader, mapping));
}
else
{
var files = SplitFileNames(mapping);
wlist = new List<string>();
foreach (string file in files)
{
var lines = GetLines(loader, file.Trim());
wlist.AddRange(lines);
}
}
NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
ParseRules(wlist, builder);
normMap = builder.Build();
if (normMap.map == null)
{
// if the inner FST is null, it means it accepts nothing (e.g. the file is empty)
// so just set the whole map to null
normMap = null;
}
}
}