"""
Created on Wed Sep 30 10:11:55 2026
@author: Lluís Vila
"""

'''
digit_words = 'zero,one,two,three,four,five,six,seven,eight,nine'
text = 'The order includes 3 beers, 2 coctails and 5 shots.'
'''


def wordize_digits(digit_words, text):
    l = digit_words.split(',')
    newtext = ''
    for c in text:
        if c.isdigit():
            newtext += f'{l[int(c)]}({c})'
        elif c.isalpha():
            newtext += c
        elif c in ',.;: ':
            newtext += c
    return newtext

            