79461067

Date: 2025-02-23 10:36:28
Score: 0.5
Natty:
Report link

Here is my solution, if you have a string and not a list of strings:


def normalize_text(text: str) -> str:
    output_string = re.sub(r'(\d+)', lambda m: num2words(m.group(), lang='en'), text)
    print(output_string)
    return output_string

based on @svandav's version

Hope it helps

Reasons:
  • Whitelisted phrase (-1): Hope it helps
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @svandav's
  • Low reputation (0.5):
Posted by: DevChris