def remove_diacritics(text : str) -> str:
'''
text : "أَهْلًا وسَهْلًا Hello 212"
output :
---> "أهلا وسهلا Hello 212"
'''
chars = [char for char in text if (char not in HARAKAT)]
output = ''.join(chars)
return output
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter