This is a vital issue so we have to make this to ensure not spaces at the start nor the end like this.
def clean_uthmani_spaces(uth_text: str):
"""remove residual spaces from the uthmani text"""
uth_text = re.sub(r"\s+", f"{alph.uthmani.space}", uth_text)
uth_text = re.sub(r"(\s$|^\s)", r"", uth_text)
return uth_text
We have to clean the uthmani text from spaces
This is a vital issue so we have to make this to ensure not spaces at the start nor the end like this.
We have to clean the uthmani text from spaces