コード例 #1
0
        public void TestSimpleGerman2()
        {
            Phonetizer p = new Phonetizer();

            p.Rules = RuleLoader.LoadFromRessource("phonet4n.Core.german_2.csv");
            Assert.AreEqual(919 * 3, p.Rules.Length);

            Assert.AreEqual("NEIA", p.Phonetize("Meier"));
            Assert.AreEqual("NEIA", p.Phonetize("Mayer"));
            Assert.AreEqual("FEIFA", p.Phonetize("Pfeiffer"));
            Assert.AreEqual("FEIFA", p.Phonetize("Pfeifer"));
        }
コード例 #2
0
        public void TestRecurringDigits_Strip()
        {
            Phonetizer p = new Phonetizer(false);

            p.Rules = RuleLoader.LoadFromRessource("phonet4n.Core.german_1.csv");
            Assert.AreEqual(919 * 3, p.Rules.Length);

            Assert.AreEqual("TEST01", p.Phonetize("Teest01"));
            Assert.AreEqual("TEST01", p.Phonetize("Teest001"));
            Assert.AreEqual("0123456789", p.Phonetize("00112233445566778899"));
            Assert.AreEqual("0", p.Phonetize("0000"));
        }
コード例 #3
0
ファイル: ComparisonTests.cs プロジェクト: trey41/phonet4n
        private void TestWordAgainsAgainstCImpl(String line)
        {
            String resultCImpl  = adapter.Phonetize(line);
            String resultDotNet = phonetizer.Phonetize(line);

            Assert.AreEqual(resultCImpl, resultDotNet, "Testing: \"" + line + "\"");
        }
コード例 #4
0
ファイル: SpeedTests.cs プロジェクト: trey41/phonet4n
 protected override void DoPhonetize(string input)
 {
     phonetizer.Phonetize(input);
 }