def strip_lastharaka(text):
"""Strip the last Haraka 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:
if is_vocalized(text):
return re.sub(LASTHARAKA_PATTERN, u'', text)
return text
评论列表
文章目录