コード例 #1
0
ファイル: Program.cs プロジェクト: reline/JmdictFurigana
        public static void Main(string[] args)
        {
            // Jmdict
            DictionaryEtl      jmdictEtl      = new DictionaryEtl(PathHelper.JmDictPath);
            FuriganaBusiness   furiganaJmdict = new FuriganaBusiness(DictionaryFile.Jmdict);
            FuriganaFileWriter jmdictWriter   = new FuriganaFileWriter(PathHelper.JmdictOutFilePath);

            jmdictWriter.Write(furiganaJmdict.Execute(jmdictEtl.Execute()));

            // Jmnedict
            DictionaryEtl      jmnedictEtl      = new DictionaryEtl(PathHelper.JmneDictPath);
            FuriganaBusiness   furiganaJmnedict = new FuriganaBusiness(DictionaryFile.Jmnedict);
            FuriganaFileWriter jmnedictWriter   = new FuriganaFileWriter(PathHelper.JmnedictOutFilePath);

            jmnedictWriter.Write(furiganaJmnedict.Execute(jmnedictEtl.Execute()));
        }
コード例 #2
0
        public void ExecuteTest_Waruguchi_FourReadings()
        {
            // Arrange
            File.Copy("Resources/Waruguchi.xml", PathHelper.JmDictPath, true);
            DictionaryEtl dictionaryEtl = new DictionaryEtl(PathHelper.JmDictPath);
            List <string> wanted        = new List <string>()
            {
                "悪口|あっこう",
                "悪口|わるくち",
                "悪口|わるぐち",
                "惡口|あっこう",
                "惡口|わるくち",
                "惡口|わるぐち"
            };

            // Act
            List <VocabEntry> results          = dictionaryEtl.Execute().ToList();
            List <string>     resultsAsStrings = results.Select(r => r.ToString()).ToList();

            // Assert
            Assert.AreEqual(6, results.Count);
            CollectionAssert.AreEquivalent(wanted, resultsAsStrings);
        }