コード例 #1
0
ファイル: LanguageReader.cs プロジェクト: drupaltr/nuve
        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);
        }
コード例 #2
0
ファイル: MutableLanguage.cs プロジェクト: hrzafer/nuve
 private MutableLanguage(LanguageType type,
     Orthography orthography,
     Morphotactics morphotactics,
     MorphemeContainer<Root> roots,
     MorphemeContainer<Suffix> suffixes)
     : base(type, orthography, morphotactics, roots, suffixes)
 {
 }
コード例 #3
0
ファイル: LanguageReader.cs プロジェクト: hrzafer/nuve
        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);
        }
コード例 #4
0
ファイル: LanguageReader.cs プロジェクト: hrzafer/nuve
        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);
        }
コード例 #5
0
 public SuffixLexiconReader(Orthography orthography)
 {
     _orthography = orthography;
 }
コード例 #6
0
ファイル: RootLexiconReader.cs プロジェクト: hrzafer/nuve
 public RootLexiconReader(Orthography orthography)
 {
     _orthography = orthography;
 }