__init__.py 文件源码

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

项目:dupandas 作者: shivam5992 项目源码 文件源码
def match_elements(self, text1, text2):
        """
        utility function to match two strings, makes use of 
        match config initiated in __init__ 

        returns the output as confidence score of flexible match
        """

        conf = 0
        if self.m_config['exact']:
            if text1 == text2:
                conf += 1

        if self.m_config['levenshtein']:
            conf += ratio(text1, text2)

        if self.m_config['soundex']:
            if soundex(text1) == soundex(text2):
                conf += 1

        if self.m_config['nysiis']:
            if fuzzy.nysiis(text1) == fuzzy.nysiis(text2):
                conf += 1

        return conf
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号