private MorphemeSurfaceDictionary <Root> ReadRoots()
{
try
{
var roots = new MorphemeSurfaceDictionary <Root>();
var reader = new RootLexiconReader(_orthography);
string rootsPath = _dirPath + _seperator + Resources.InternalMainRootsPath;
if (_external)
{
using (var stream = new FileStream(rootsPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
reader.AddEntries(TextToDataSet.Convert(stream, DefaultTableName, Delimiter), DefaultTableName,
roots);
}
return(roots);
}
reader.AddEntries(EmbeddedTextResourceToDataSet(rootsPath), DefaultTableName, roots);
string namesPath = _dirPath + _seperator + Resources.InternalPersonNamesPath;
reader.AddEntries(EmbeddedTextResourceToDataSet(namesPath), DefaultTableName, roots);
string abbreviationPath = _dirPath + _seperator + Resources.InternalAbbreviationsPath;
reader.AddEntries(EmbeddedTextResourceToDataSet(abbreviationPath), DefaultTableName, roots);
return(roots);
}
catch (Exception ex)
{
throw new InvalidLanguageFileException(ex, Type.Roots, "Invalid language file for roots: ");
}
}