<commit_before><commit_msg>Added loading of config json files in util<commit_after>import os
import json


lex_fp = open(os.path.join(os.path.dirname(__file__), '../resources/lex.json'), 'r')
inflections_fp = open(os.path.join(os.path.dirname(__file__), '../resources/inflections.json'), 'r')
lex = json.load(lex_fp)
inflections = json.load(inflections_fp)

lex_fp.close()
inflections_fp.close()


def parse_lexical_entry_rule(name):
    stem = pos = gloss = None
    name = name.split("_")

    if len(name) > 0:
        stem = name[0]

    if len(name) > 1:
        pos = name[1]

    if len(name) > 2:
        gloss = name[2]

    return [stem, pos, gloss]
{'fraction_non_alphanumeric': 0.15326251896813353, 'fraction_numerical': 0.009104704097116844, 'mean_word_length': 3.5205479452054793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '6317024', 'n_tokens_mistral': 245, 'n_tokens_neox': 232, 'n_words': 52}