示例#1
0
class ONCATestCases(unittest.TestCase):
    """Test ONCA functions.

    test cases for abydos.phonetic.ONCA
    """

    pa = ONCA()

    def test_onca(self):
        """Test abydos.phonetic.ONCA."""
        # https://nces.ed.gov/FCSM/pdf/RLT97.pdf
        self.assertEqual(self.pa.encode('HALL'), 'H400')
        self.assertEqual(self.pa.encode('SMITH'), 'S530')

        # http://nchod.uhce.ox.ac.uk/NCHOD%20Oxford%20E5%20Report%201st%20Feb_VerAM2.pdf
        self.assertEqual(self.pa.encode('HAWTON'), 'H350')
        self.assertEqual(self.pa.encode('HORTON'), 'H635')
        self.assertEqual(self.pa.encode('HOUGHTON'), 'H235')

        # encode_alpha
        self.assertEqual(self.pa.encode_alpha('HALL'), 'HL')
        self.assertEqual(self.pa.encode_alpha('SMITH'), 'SNT')
        self.assertEqual(self.pa.encode_alpha('HOUGHTON'), 'HKTN')

        # Test wrapper
        self.assertEqual(onca('HALL'), 'H400')
示例#2
0
 'henry_early': HenryEarly().encode,
 'henry_early_ml8': HenryEarly(max_length=8).encode,
 'koelner_phonetik': Koelner().encode,
 'koelner_phonetik_alpha': Koelner().encode_alpha,
 'lein': LEIN().encode,
 'lein_nopad_ml8': LEIN(max_length=8, zero_pad=False).encode,
 'metasoundex': MetaSoundex().encode,
 'metasoundex_es': MetaSoundex(lang='es').encode,
 'metaphone': Metaphone().encode,
 'mra': MRA().encode,
 'norphone': Norphone().encode,
 'nrl': NRL().encode,
 'nysiis': NYSIIS().encode,
 'nysiis_modified': NYSIIS(modified=True).encode,
 'nysiis_ml_inf': NYSIIS(max_length=-1).encode,
 'onca': ONCA().encode,
 'onca_nopad_ml8': ONCA(max_length=8, zero_pad=False).encode,
 'parmar_kumbharana': ParmarKumbharana().encode,
 'phonem': Phonem().encode,
 'phonet_1': Phonet().encode,
 'phonet_2': Phonet(mode=2).encode,
 'phonet_1_none': Phonet(lang='none').encode,
 'phonet_2_none': Phonet(mode=2, lang='none').encode,
 'phonetic_spanish': PhoneticSpanish().encode,
 'phonetic_spanish_ml4': PhoneticSpanish(max_length=4).encode,
 'phonex': Phonex().encode,
 'phonex_0pad_ml6': Phonex(max_length=6, zero_pad=True).encode,
 'phonic': PHONIC().encode,
 'phonic_0pad_ml6': PHONIC(max_length=6, zero_pad=True).encode,
 'phonic_ext': PHONIC(extended=True).encode,
 'phonix': Phonix().encode,
示例#3
0
 'metaphone':
 Metaphone().encode,
 'mra':
 MRA().encode,
 'norphone':
 Norphone().encode,
 'nrl':
 NRL().encode,
 'nysiis':
 NYSIIS().encode,
 'nysiis_modified':
 NYSIIS(modified=True).encode,
 'nysiis_ml_inf':
 NYSIIS(max_length=-1).encode,
 'onca':
 ONCA().encode,
 'onca_nopad_ml8':
 ONCA(max_length=8, zero_pad=False).encode,
 'parmar_kumbharana':
 ParmarKumbharana().encode,
 'phonem':
 Phonem().encode,
 'phonet_1':
 Phonet().encode,
 'phonet_2':
 Phonet(mode=2).encode,
 'phonet_1_none':
 Phonet(lang='none').encode,
 'phonet_2_none':
 Phonet(mode=2, lang='none').encode,
 'phonetic_spanish':
示例#4
0
dolby = Dolby()
double_metaphone = DoubleMetaphone()
eudex = Eudex()
fonem = FONEM()
fuzzy_soundex = FuzzySoundex()
haase = Haase()
henry_early = HenryEarly()
koelner = Koelner()
lein = Lein()
metaphone = Metaphone()
metasoundex = MetaSoundex()
mra = MRA()
norphone = Norphone()
nrl = NRL()
nysiis = NYSIIS()
onca = ONCA()
parmar_kumbharana = ParmarKumbharana()
phonem = Phonem()
phonet = Phonet()
phonetic_spanish = PhoneticSpanish()
phonex = Phonex()
phonix = Phonix()
pshp_soundex_first = PSHPSoundexFirst()
pshp_soundex_last = PSHPSoundexLast()
refined_soundex = RefinedSoundex()
reth_schek = RethSchek()
roger_root = RogerRoot()
russell = RussellIndex()
sfinxbis = SfinxBis()
sound_d = SoundD()
soundex = Soundex()