How to use the poetry.apps.corpus.scripts.main.markup.Syllable function in poetry

To help you get started, we’ve selected a few poetry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
def test_syllables(self):
        checks = {
            'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
            'оттечь': [Syllable(0, 1, 0, 'о'), Syllable(1, 6, 1, 'ттечь')],
            'дяденька': [Syllable(0, 2, 0, 'дя'), Syllable(2, 6, 1, 'день'), Syllable(6, 8, 2, 'ка')],
            'подъезд': [Syllable(0, 2, 0, 'по'), Syllable(2, 7, 1, 'дъезд')],
            'морские': [Syllable(0, 3, 0, 'мор'), Syllable(3, 6, 1, 'ски'), Syllable(6, 7, 2, 'е')],
            'мерзкие': [Syllable(0, 3, 0, 'мер'), Syllable(3, 6, 1, 'зки'), Syllable(6, 7, 2, 'е')],
            'полный': [Syllable(0, 2, 0, 'по'), Syllable(2, 6, 1, 'лный')],
            'зародыш': [Syllable(0, 2, 0, 'за'), Syllable(2, 4, 1, 'ро'), Syllable(4, 7, 2, 'дыш')],
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
def test_syllables(self):
        checks = {
            'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
            'оттечь': [Syllable(0, 1, 0, 'о'), Syllable(1, 6, 1, 'ттечь')],
            'дяденька': [Syllable(0, 2, 0, 'дя'), Syllable(2, 6, 1, 'день'), Syllable(6, 8, 2, 'ка')],
            'подъезд': [Syllable(0, 2, 0, 'по'), Syllable(2, 7, 1, 'дъезд')],
            'морские': [Syllable(0, 3, 0, 'мор'), Syllable(3, 6, 1, 'ски'), Syllable(6, 7, 2, 'е')],
            'мерзкие': [Syllable(0, 3, 0, 'мер'), Syllable(3, 6, 1, 'зки'), Syllable(6, 7, 2, 'е')],
            'полный': [Syllable(0, 2, 0, 'по'), Syllable(2, 6, 1, 'лный')],
            'зародыш': [Syllable(0, 2, 0, 'за'), Syllable(2, 4, 1, 'ро'), Syllable(4, 7, 2, 'дыш')],
            'война': [Syllable(0, 3, 0, 'вой'), Syllable(3, 5, 1, 'на')],
        }

        for word, borders in checks.items():
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
def test_syllables(self):
        checks = {
            'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
def test_syllables(self):
        checks = {
            'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
            'оттечь': [Syllable(0, 1, 0, 'о'), Syllable(1, 6, 1, 'ттечь')],
            'дяденька': [Syllable(0, 2, 0, 'дя'), Syllable(2, 6, 1, 'день'), Syllable(6, 8, 2, 'ка')],
            'подъезд': [Syllable(0, 2, 0, 'по'), Syllable(2, 7, 1, 'дъезд')],
            'морские': [Syllable(0, 3, 0, 'мор'), Syllable(3, 6, 1, 'ски'), Syllable(6, 7, 2, 'е')],
            'мерзкие': [Syllable(0, 3, 0, 'мер'), Syllable(3, 6, 1, 'зки'), Syllable(6, 7, 2, 'е')],
            'полный': [Syllable(0, 2, 0, 'по'), Syllable(2, 6, 1, 'лный')],
            'зародыш': [Syllable(0, 2, 0, 'за'), Syllable(2, 4, 1, 'ро'), Syllable(4, 7, 2, 'дыш')],
            'война': [Syllable(0, 3, 0, 'вой'), Syllable(3, 5, 1, 'на')],
        }
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
def test_syllables(self):
        checks = {
            'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
            'оттечь': [Syllable(0, 1, 0, 'о'), Syllable(1, 6, 1, 'ттечь')],
            'дяденька': [Syllable(0, 2, 0, 'дя'), Syllable(2, 6, 1, 'день'), Syllable(6, 8, 2, 'ка')],
            'подъезд': [Syllable(0, 2, 0, 'по'), Syllable(2, 7, 1, 'дъезд')],
            'морские': [Syllable(0, 3, 0, 'мор'), Syllable(3, 6, 1, 'ски'), Syllable(6, 7, 2, 'е')],
            'мерзкие': [Syllable(0, 3, 0, 'мер'), Syllable(3, 6, 1, 'зки'), Syllable(6, 7, 2, 'е')],
            'полный': [Syllable(0, 2, 0, 'по'), Syllable(2, 6, 1, 'лный')],
            'зародыш': [Syllable(0, 2, 0, 'за'), Syllable(2, 4, 1, 'ро'), Syllable(4, 7, 2, 'дыш')],
            'война': [Syllable(0, 3, 0, 'вой'), Syllable(3, 5, 1, 'на')],
        }
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / rhymes / test_rhymes.py View on Github external
def test_rhyme(self):
        if os.path.exists(MARKUPS_DUMP_XML_PATH):
            Rhymes.get_all_words()
        self.assertTrue(Rhymes.is_rhyme(Word(0, 4, "тишь", [Syllable(0, 4, 0, "тишь", 1)]),
                                        Word(0, 8, "грустишь", [Syllable(0, 3, 0, "гру"),
                                                                Syllable(3, 8, 1, "стишь", 5)])))
        self.assertFalse(Rhymes.is_rhyme(Word(0, 8, "наизусть", [Syllable(0, 2, 0, "на"), Syllable(2, 4, 1, "из"),
                                                                 Syllable(4, 8, 2, "усть", 4)]),
                                         Word(0, 6, "сестра", [Syllable(0, 3, 0, "сест"),
                                                               Syllable(3, 6, 1, "ра", 5)])))
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
def test_syllables(self):
        checks = {
            'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
            'оттечь': [Syllable(0, 1, 0, 'о'), Syllable(1, 6, 1, 'ттечь')],
            'дяденька': [Syllable(0, 2, 0, 'дя'), Syllable(2, 6, 1, 'день'), Syllable(6, 8, 2, 'ка')],
            'подъезд': [Syllable(0, 2, 0, 'по'), Syllable(2, 7, 1, 'дъезд')],
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / main / test_phonetics.py View on Github external
'я': [Syllable(0, 1, 0, 'я')],
            'в': [],
            'лдж': [],
            'кронв': [Syllable(0, 5, 0, 'кронв')],
            'он': [Syllable(0, 2, 0, 'он')],
            'когда': [Syllable(0, 2, 0, 'ко'), Syllable(2, 5, 1, 'гда')],
            'майка': [Syllable(0, 3, 0, 'май'), Syllable(3, 5, 1, 'ка')],
            'сонька': [Syllable(0, 4, 0, 'сонь'), Syllable(4, 6, 1, 'ка')],
            'соломка': [Syllable(0, 2, 0, 'со'), Syllable(2, 5, 1, 'лом'), Syllable(5, 7, 2, 'ка')],
            'изжить': [Syllable(0, 1, 0, 'и'), Syllable(1, 6, 1, 'зжить')],
            'виться': [Syllable(0, 2, 0, 'ви'), Syllable(2, 6, 1, 'ться')],
            'данный': [Syllable(0, 2, 0, 'да'), Syllable(2, 6, 1, 'нный')],
            'марка': [Syllable(0, 3, 0, 'мар'), Syllable(3, 5, 1, 'ка')],
            'зорька': [Syllable(0, 4, 0, 'зорь'), Syllable(4, 6, 1, 'ка')],
            'банка': [Syllable(0, 3, 0, 'бан'), Syllable(3, 5, 1, 'ка')],
            'банька': [Syllable(0, 4, 0, 'бань'), Syllable(4, 6, 1, 'ка')],
            'лайка': [Syllable(0, 3, 0, 'лай'), Syllable(3, 5, 1, 'ка')],
            'оттечь': [Syllable(0, 1, 0, 'о'), Syllable(1, 6, 1, 'ттечь')],
            'дяденька': [Syllable(0, 2, 0, 'дя'), Syllable(2, 6, 1, 'день'), Syllable(6, 8, 2, 'ка')],
            'подъезд': [Syllable(0, 2, 0, 'по'), Syllable(2, 7, 1, 'дъезд')],
            'морские': [Syllable(0, 3, 0, 'мор'), Syllable(3, 6, 1, 'ски'), Syllable(6, 7, 2, 'е')],
            'мерзкие': [Syllable(0, 3, 0, 'мер'), Syllable(3, 6, 1, 'зки'), Syllable(6, 7, 2, 'е')],
            'полный': [Syllable(0, 2, 0, 'по'), Syllable(2, 6, 1, 'лный')],
            'зародыш': [Syllable(0, 2, 0, 'за'), Syllable(2, 4, 1, 'ро'), Syllable(4, 7, 2, 'дыш')],
            'война': [Syllable(0, 3, 0, 'вой'), Syllable(3, 5, 1, 'на')],
        }

        for word, borders in checks.items():
            self.assertEqual(Phonetics.get_word_syllables(word), borders)
github IlyaGusev / PoetryCorpus / poetry / apps / corpus / scripts / rhymes / test_rhymes.py View on Github external
def test_rhyme(self):
        if os.path.exists(MARKUPS_DUMP_XML_PATH):
            Rhymes.get_all_words()
        self.assertTrue(Rhymes.is_rhyme(Word(0, 4, "тишь", [Syllable(0, 4, 0, "тишь", 1)]),
                                        Word(0, 8, "грустишь", [Syllable(0, 3, 0, "гру"),
                                                                Syllable(3, 8, 1, "стишь", 5)])))
        self.assertFalse(Rhymes.is_rhyme(Word(0, 8, "наизусть", [Syllable(0, 2, 0, "на"), Syllable(2, 4, 1, "из"),
                                                                 Syllable(4, 8, 2, "усть", 4)]),
                                         Word(0, 6, "сестра", [Syllable(0, 3, 0, "сест"),
                                                               Syllable(3, 6, 1, "ра", 5)])))