コード例 #1
0
ファイル: test_elision.py プロジェクト: bkovitz/signatrix
    def test_two_elisions(self):
        line = Line('rem hida it')

        letters = generate_elisions(line.letters)
        self.assertCountEqual(
            reduce_to_text(letters),
            Multiple(
                ['r', Elision('e', 'm', 'h'), 'i', 'd', Elision('a'), 'i', 't'],
                ['r', 'e', 'm', hiatus, 'h', 'i', 'd', Elision('a'), 'i', 't'],
                ['r', Elision('e', 'm', 'h'), 'i', 'd', 'a', hiatus, 'i', 't'],
                ['r', 'e', 'm', hiatus, 'h', 'i', 'd', 'a', hiatus, 'i', 't'],
            )
        )
コード例 #2
0
ファイル: test_elision.py プロジェクト: bkovitz/signatrix
    def test_simplest(self):
        line = Line('re id')

        letters = generate_elisions(line.letters)
        self.assertEqual(letters[0][0].__class__, Letter)
        self.assertCountEqual(
            reduce_to_text(letters),
            Multiple(
                ['r', Elision('e'), 'i', 'd'],
                ['r', 'e', hiatus, 'i', 'd'],
            )
        )

        self.assertCountEqual(
            [' '.join(str(letter) for letter in e)
                for e in line.with_elisions
            ],
            [
                'r(e) i d',
                'r e i d'
            ]
        )