<commit_before># utilities.add_language

# This language utility adds support for a language to YouVersion Suggest by
# gathering and parsing data from the YouVersion website to create all needed
# language files; this utility can also be used to update any Bible data for an
# already-supported language

from __future__ import unicode_literals

import argparse
import io
import itertools
import json
import os
from operator import itemgetter

import utilities.book_parser as book_parser
import utilities.language_parser as language_parser
import utilities.version_parser as version_parser

# Parameters for structuring JSON data
JSON_PARAMS = {
    'indent': 2,
    'separators': (',', ': '),
    'ensure_ascii': False,
    'sort_keys': True
}


# Retrieve the language name from the YouVersion website
def get_language_name(language_id):

    print('Retrieving language data...')
    language_name = language_parser.get_language_name(language_id)
    if not language_name:
        raise RuntimeError('Cannot retrieve language data. Aborting.')


# Returns a copy of the given version list with duplicates removed
def get_unique_versions(versions):
<commit_msg>Fix bug where language name was not being returned<commit_after># utilities.add_language

# This language utility adds support for a language to YouVersion Suggest by
# gathering and parsing data from the YouVersion website to create all needed
# language files; this utility can also be used to update any Bible data for an
# already-supported language

from __future__ import unicode_literals

import argparse
import io
import itertools
import json
import os
from operator import itemgetter

import utilities.book_parser as book_parser
import utilities.language_parser as language_parser
import utilities.version_parser as version_parser

# Parameters for structuring JSON data
JSON_PARAMS = {
    'indent': 2,
    'separators': (',', ': '),
    'ensure_ascii': False,
    'sort_keys': True
}


# Retrieve the language name from the YouVersion website
def get_language_name(language_id):

    print('Retrieving language data...')
    language_name = language_parser.get_language_name(language_id)
    if not language_name:
        raise RuntimeError('Cannot retrieve language data. Aborting.')
    return language_name


# Returns a copy of the given version list with duplicates removed
def get_unique_versions(versions):

{'fraction_non_alphanumeric': 0.05695142378559464, 'fraction_numerical': 0.0008375209380234506, 'mean_word_length': 4.92803970223325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '485426', 'n_tokens_mistral': 641, 'n_tokens_neox': 614, 'n_words': 256}