Common.py
def versions_transformer(query_input, versions_dict_input):
    """Grabs the version and casts it to a list"""
    processed_query = query_input.upper()
    for i in list(versions_dict_input.keys()):
        result = re.search(str(i), processed_query)
        if result is not None:
            version = versions_dict_input[result.group(0)]
            reduced_query = processed_query.replace(result.group(0), '')
            return [version, reduced_query]
    failover_reduced_query = processed_query.split(' ')
    failover_reduced_query = failover_reduced_query.pop(len(failover_reduced_query) - 1)
    return [versions_dict_input['KJV'], str.join('', failover_reduced_query)]
Grabs the version and casts it to a list
Grabs the version and casts it to a list
Grabs the version and casts it to a list
def versions_transformer(query_input, versions_dict_input):
    processed_query = query_input.upper()
    for i in list(versions_dict_input.keys()):
        result = re.search(str(i), processed_query)
        if result is not None:
            version = versions_dict_input[result.group(0)]
            reduced_query = processed_query.replace(result.group(0), '')
            return [version, reduced_query]
    failover_reduced_query = processed_query.split(' ')
    failover_reduced_query = failover_reduced_query.pop(len(failover_reduced_query) - 1)
    return [versions_dict_input['KJV'], str.join('', failover_reduced_query)]
def versions_transformer ( query_input , versions_dict_input ) : processed_query = query_input . upper ( ) for i in list ( versions_dict_input . keys ( ) ) : result = re . search ( str ( i ) , processed_query ) if result is not None : version = versions_dict_input [ result . group ( 0 ) ] reduced_query = processed_query . replace ( result . group ( 0 ) , '' ) return [ version , reduced_query ] failover_reduced_query = processed_query . split ( ' ' ) failover_reduced_query = failover_reduced_query . pop ( len ( failover_reduced_query ) - 1 ) return [ versions_dict_input [ 'KJV' ] , str . join ( '' , failover_reduced_query ) ]
Grabs the version and casts it to a list
Grabs the version and casts it to a list
"""Grabs the version and casts it to a list"""
query_input
versions_dict_input