def strip_harakat(text):
"""Strip Harakat from arabic word except Shadda.
The striped marks are :
- FATHA, DAMMA, KASRA
- SUKUN
- FATHATAN, DAMMATAN, KASRATAN, , , .
Example:
>>> text = u"?????????????"
>>> stripTashkeel(text)
????????
@param text: arabic text.
@type text: unicode.
@return: return a striped text.
@rtype: unicode.
"""
# if text:
# return re.sub(HARAKAT_PATTERN, u'', text)
# return text
if not text:
return text
elif is_vocalized(text):
for char in HARAKAT:
text = text.replace(char, '')
return text
评论列表
文章目录