normalize.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:tashaphyne 作者: linuxscout 项目源码 文件源码
def strip_tashkeel(text):
    """Strip vowel from a text and return a result text.
    The striped marks are :
        - FATHA, DAMMA, KASRA
        - SUKUN
        - SHADDA
        - FATHATAN, DAMMATAN, KASRATAN, , , .
    Example:
        >>> text=u"?????????????"
        >>> strip_tashkeel(text)
        ???????

    @param text: arabic text.
    @type text: unicode.
    @return: return a striped text.
    @rtype: unicode.
    """
    return arabconst.HARAKAT_PAT.sub('', text)


#strip tatweel from a text and return a result text
#--------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号