<commit_before>def characterToGlyphName(c, cmap):
    try:
        c = unicode(c)
        v = ord(c)
        v = cmap.get(v)
        if isinstance(v, list):
            v = v[0]
        return v
    except UnicodeDecodeError:
        return None


def splitText(text, cmap, fallback=".notdef"):
    """
    Break a string of characters or / delimited glyph names
    into a list.

    - Test name compiling
    >>> splitText("/a", {})
    ['a']
    >>> splitText("/aacute/bbreve", {})
    ['aacute', 'bbreve']
    >>> splitText("/aacute /bbreve", {})
    ['aacute', 'bbreve']
    >>> splitText("/cmb:dieresis /cmb:acute", {})
    ['cmb:dieresis', 'cmb:acute']
    >>> splitText("/cmb-dieresis /cmb-acute", {})<commit_msg>Makes the characterToGlyphName function compatible with Python 3 (but not 2 but that seems okay) by removing the unicode() function call (#32)<commit_after>def characterToGlyphName(c, cmap):
    v = ord(c)
    v = cmap.get(v)
    if isinstance(v, list):
        v = v[0]
    return v


def splitText(text, cmap, fallback=".notdef"):
    """
    Break a string of characters or / delimited glyph names
    into a list.

    - Test name compiling
    >>> splitText("/a", {})
    ['a']
    >>> splitText("/aacute/bbreve", {})
    ['aacute', 'bbreve']
    >>> splitText("/aacute /bbreve", {})
    ['aacute', 'bbreve']
    >>> splitText("/cmb:dieresis /cmb:acute", {})
    ['cmb:dieresis', 'cmb:acute']
    >>> splitText("/cmb-dieresis /cmb-acute", {})
{'fraction_non_alphanumeric': 0.17983651226158037, 'fraction_numerical': 0.004087193460490463, 'mean_word_length': 2.7666666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '3614552', 'n_tokens_mistral': 534, 'n_tokens_neox': 504, 'n_words': 124}