How to use the cltk.prosody.latin.string_utils.remove_blanks function in cltk

To help you get started, we’ve selected a few cltk 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 cltk / cltk / cltk / prosody / latin / syllabifier.py View on Github external
(start, end) = match.span()
            positions.append(start)
        letters = string_utils.merge_next(letters, positions)
        letters = string_utils.remove_blanks(letters)
        positions.clear()
        if not self._contains_vowels("".join(letters)):
            return ["".join(letters).strip()]  # occurs when only 'qu' appears by ellision
        positions = self._starting_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_right(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._starting_consonants_only(letters)
        positions = self._ending_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_left(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._ending_consonants_only(letters)
        positions = self._find_solo_consonant(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_solo_consonant(letters)
        positions = self._find_consonant_cluster(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_consonant_cluster(letters)
        return letters
github cltk / cltk / cltk / prosody / latin / syllabifier.py View on Github external
letters = string_utils.remove_blanks(letters)
            positions = self._starting_consonants_only(letters)
        positions = self._ending_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_left(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._ending_consonants_only(letters)
        positions = self._find_solo_consonant(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_solo_consonant(letters)
        positions = self._find_consonant_cluster(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_consonant_cluster(letters)
        return letters
github cltk / cltk / cltk / prosody / latin / syllabifier.py View on Github external
if not self._contains_vowels("".join(letters)):
            return ["".join(letters).strip()]  # occurs when only 'qu' appears by ellision
        positions = self._starting_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_right(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._starting_consonants_only(letters)
        positions = self._ending_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_left(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._ending_consonants_only(letters)
        positions = self._find_solo_consonant(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_solo_consonant(letters)
        positions = self._find_consonant_cluster(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_consonant_cluster(letters)
        return letters
github cltk / cltk / cltk / prosody / latin / syllabifier.py View on Github external
for match in matches:
                    (start, end) = match.span()
                    positions.append(start)
        matches = self.kw_matcher.finditer(my_word)
        for match in matches:
            (start, end) = match.span()
            positions.append(start)
        letters = string_utils.merge_next(letters, positions)
        letters = string_utils.remove_blanks(letters)
        positions.clear()
        if not self._contains_vowels("".join(letters)):
            return ["".join(letters).strip()]  # occurs when only 'qu' appears by ellision
        positions = self._starting_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_right(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._starting_consonants_only(letters)
        positions = self._ending_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_left(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._ending_consonants_only(letters)
        positions = self._find_solo_consonant(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_solo_consonant(letters)
        positions = self._find_consonant_cluster(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._find_consonant_cluster(letters)
github cltk / cltk / cltk / prosody / latin / syllabifier.py View on Github external
my_word = " " + word + " "
        letters = list(my_word)
        positions = []
        for dipth in self.diphthongs:
            if dipth in my_word:
                dipth_matcher = re.compile("{}".format(dipth))
                matches = dipth_matcher.finditer(my_word)
                for match in matches:
                    (start, end) = match.span()
                    positions.append(start)
        matches = self.kw_matcher.finditer(my_word)
        for match in matches:
            (start, end) = match.span()
            positions.append(start)
        letters = string_utils.merge_next(letters, positions)
        letters = string_utils.remove_blanks(letters)
        positions.clear()
        if not self._contains_vowels("".join(letters)):
            return ["".join(letters).strip()]  # occurs when only 'qu' appears by ellision
        positions = self._starting_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_right(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._starting_consonants_only(letters)
        positions = self._ending_consonants_only(letters)
        while len(positions) > 0:
            letters = string_utils.move_consonant_left(letters, positions)
            letters = string_utils.remove_blanks(letters)
            positions = self._ending_consonants_only(letters)
        positions = self._find_solo_consonant(letters)
        while len(positions) > 0:
            letters = self._move_consonant(letters, positions)