<commit_before>__author__ = ['<NAME> <<EMAIL>>']
__license__ = 'MIT License. See LICENSE.'

import logging
import unicodedata

from collections import defaultdict
from cltk.exceptions import InputError
from cltk.corpus.middle_english.syllabifier import Syllabifier as ME_Syllabifier
from cltk.corpus.middle_high_german.syllabifier import Syllabifier as MHG_Syllabifier
from cltk.corpus.old_english.syllabigier import Syllabifier as OE_Syllabifier
from cltk.corpus.old_norse.syllabifier import hierarchy as OLD_NORSE_HIERARCHY

LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())


def get_onsets(text, vowels="aeiou", threshold=0.0002):
    """
    Source: Resonances in Middle High German: New Methodologies in Prosody,
    2017, <NAME>

    :param text: str list: text to be analysed

    :param vowels: str: valid vowels constituting the syllable

    :param threshold: minimum frequency count for valid onset, <NAME> noted
    that the algorithm produces the best result for an untagged wordset of MHG,<commit_msg>Update syllabify.py<commit_after>__author__ = ['<NAME> <<EMAIL>>']
__license__ = 'MIT License. See LICENSE.'

import logging
import unicodedata

from collections import defaultdict
from cltk.exceptions import InputError
from cltk.corpus.middle_english.syllabifier import Syllabifier as ME_Syllabifier
from cltk.corpus.middle_high_german.syllabifier import Syllabifier as MHG_Syllabifier
from cltk.corpus.old_english.syllabifier import Syllabifier as OE_Syllabifier
from cltk.corpus.old_norse.syllabifier import hierarchy as OLD_NORSE_HIERARCHY

LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())


def get_onsets(text, vowels="aeiou", threshold=0.0002):
    """
    Source: Resonances in Middle High German: New Methodologies in Prosody,
    2017, <NAME>

    :param text: str list: text to be analysed

    :param vowels: str: valid vowels constituting the syllable

    :param threshold: minimum frequency count for valid onset, <NAME> noted
    that the algorithm produces the best result for an untagged wordset of MHG,
{'fraction_non_alphanumeric': 0.07060518731988473, 'fraction_numerical': 0.008645533141210375, 'mean_word_length': 5.4489164086687305, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4909086', 'n_tokens_mistral': 694, 'n_tokens_neox': 646, 'n_words': 204}