예제 #1
0
파일: tools.py 프로젝트: seli07/dedupclaims
    def __init__(self, path, similarity_name, threshold):
        if not (os.path.exists(path)) or not (os.path.isdir(path)):
            err_msg = (
                '"{}" does not exists or it is not a directory.').format(path)
            raise IOError(err_msg)

        self.db = simstring.reader(
            prepare_string_for_db_input(os.path.join(path, 'dup.simstring')))
        self.db.measure = getattr(simstring, similarity_name)
        self.db.threshold = threshold
예제 #2
0
    def __init__(self, path, similarity_name, threshold):
        if not(os.path.exists(path)) or not(os.path.isdir(path)):
            err_msg = (
                '"{}" does not exists or it is not a directory.'
            ).format(path)
            raise IOError(err_msg)

        self.db = simstring.reader(
            prepare_string_for_db_input(
                os.path.join(path, 'umls-terms.simstring')
            )
        )
        self.db.measure = getattr(simstring, similarity_name)
        self.db.threshold = threshold