public Language Read() { var sw = new Stopwatch(); sw.Start(); _orthography = ReadOrthography(); Debug.Print("orthograpy: " + sw.ElapsedMilliseconds.ToString() + " ms"); sw.Restart(); Morphotactics morphotactics = ReadMorphotactics(); Debug.Print("morphotactics: " + sw.ElapsedMilliseconds.ToString() + " ms"); sw.Restart(); MorphemeSurfaceDictionary<Root> roots = ReadRoots(); Debug.Print("roots: " + sw.ElapsedMilliseconds.ToString() + " ms"); sw.Restart(); Suffixes suffixes = ReadSuffixes(); Debug.Print("suffixes: " + sw.ElapsedMilliseconds.ToString() + " ms"); sw.Restart(); int index = _dirPath.LastIndexOf("\\"); string langCode = index > -1 ? _dirPath.Substring(index + 1) : _dirPath; return new Language(langCode, morphotactics, roots, suffixes); }
private MutableLanguage(LanguageType type, Orthography orthography, Morphotactics morphotactics, MorphemeContainer<Root> roots, MorphemeContainer<Suffix> suffixes) : base(type, orthography, morphotactics, roots, suffixes) { }
public Language Parse(LanguageData data) { _orthography = ParseOrthography(data.OrthographyXml); var morphotactics = ParseMorphotactics(data.MorphotacticsXml); var roots = ParseRoots(data.RootTxt); var suffixes = ParseSuffixes(data.SuffixTxt); return new Language(data.Type, _orthography, morphotactics, roots, suffixes); }
public Language Read() { var sw = new Stopwatch(); sw.Start(); _orthography = ReadOrthography(); _trace.TraceInformation($"{_dirPath} orthography loading time is {sw.ElapsedMilliseconds} ms"); sw.Restart(); var morphotactics = ReadMorphotactics(); _trace.TraceInformation($"{_dirPath} morphotactics loading time is {sw.ElapsedMilliseconds} ms"); sw.Restart(); var roots = ReadRoots(); _trace.TraceInformation($"{_dirPath} roots loading time is {sw.ElapsedMilliseconds} ms"); sw.Restart(); var suffixes = ReadSuffixes(); _trace.TraceInformation($"{_dirPath} suffixes loading time is {sw.ElapsedMilliseconds} ms"); sw.Restart(); return new Language(_languageType, _orthography, morphotactics, roots, suffixes); }
public SuffixLexiconReader(Orthography orthography) { _orthography = orthography; }
public RootLexiconReader(Orthography orthography) { _orthography = orthography; }