Exemple #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"));
        }
Exemple #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"));
        }
Exemple #3
0
        private void TestWordAgainsAgainstCImpl(String line)
        {
            String resultCImpl  = adapter.Phonetize(line);
            String resultDotNet = phonetizer.Phonetize(line);

            Assert.AreEqual(resultCImpl, resultDotNet, "Testing: \"" + line + "\"");
        }
Exemple #4
0
 protected override void DoPhonetize(string input)
 {
     phonetizer.Phonetize(input);
 }