import re

def transform(line,file):
    pattern = re.compile("-")
    listfile = []
    ################
    csvfile = '''twenty-two\t22
seventy-two thousand\t72000'''
    rscf = csvfile.splitlines()
    ######
    #with open(file,"r") as rscf :
    dictRessource = dict()
    for row in rscf:
        listfile.append(row.split('\t'))
    dictRessource = {str(rows[0]):str(rows[1]) for rows in listfile}
    
    regex = "|".join([r"\b{}\b(?!((\s?\b\d\b\s?)|(\s?(hundred|thousand|mille|milliard|million|billion|trillion))?(\s?\(?\d?{}\)?)))".format(x.replace('-', r'[\s-]'), y) for x,y in dictRessource.items()])  
    return re.sub(f'{regex}', lambda match: dictRessource[match.group(0).lower().replace(' ', '-')], line, flags=re.IGNORECASE) 
    
print( transform("Some tWenty-two things and twEnty two ...", "file") )