예제 #1
0
        public Language Read()
        {
            var sw = new Stopwatch();

            sw.Start();

            _orthography = ReadOrthography();
            Debug.Print($"orthograpy: {sw.ElapsedMilliseconds} ms");
            sw.Restart();

            Morphotactics morphotactics = ReadMorphotactics();

            Debug.Print($"morphotactics: {sw.ElapsedMilliseconds} ms");
            sw.Restart();

            MorphemeSurfaceDictionary <Root> roots = ReadRoots();

            Debug.Print($"roots: {sw.ElapsedMilliseconds} ms");
            sw.Restart();

            Suffixes suffixes = ReadSuffixes();

            Debug.Print($"suffixes: {sw.ElapsedMilliseconds} ms");
            sw.Restart();


            int index = _dirPath.LastIndexOf("\\", StringComparison.Ordinal);

            string langCode = index > -1 ? _dirPath.Substring(index + 1) : _dirPath;

            return(new Language(langCode, morphotactics, roots, suffixes));
        }
예제 #2
0
 private MutableLanguage(LanguageType type,
                         Orthography orthography,
                         Morphotactics morphotactics,
                         MorphemeContainer <Root> roots,
                         MorphemeContainer <Suffix> suffixes)
     : base(type, orthography, morphotactics, roots, suffixes)
 {
 }
예제 #3
0
파일: Language.cs 프로젝트: KeliBox/nuve
 internal Language(string code,
                   Morphotactics morphotactics,
                   MorphemeSurfaceDictionary <Root> roots,
                   Suffixes suffixes)
 {
     _code         = code;
     Morphotactics = morphotactics;
     _roots        = roots;
     _suffixes     = suffixes;
 }
예제 #4
0
 internal Language(LanguageType type,
                   Orthography orthography,
                   Morphotactics morphotactics,
                   MorphemeContainer <Root> roots,
                   MorphemeContainer <Suffix> suffixes)
 {
     Type          = type;
     Orthography   = orthography;
     Morphotactics = morphotactics;
     Roots         = roots;
     Suffixes      = suffixes;
     Analyzer      = new WordAnalyzer(this);
 }