# Path: py_stringsimjoin/utils/generic_helper.py
# COMP_OP_MAP = {'>=': operator.ge,
#                '>': operator.gt,
#                '<=': operator.le,
#                '<': operator.lt,
#                '=': operator.eq,
#                '!=': operator.ne}


import os
import numpy as np
import pandas as pd
from py_stringmatching.tokenizer.tokenizer import Tokenizer
from py_stringmatching.tokenizer.qgram_tokenizer import QgramTokenizer
from py_stringsimjoin.utils.generic_helper import COMP_OP_MAP


def validate_sim_measure_type(sim_measure_type):
    """Check if the input sim_measure_type is one of the supported types."""
    sim_measure_types = ['COSINE', 'DICE', 'EDIT_DISTANCE', 'JACCARD',
                         'OVERLAP']
    if sim_measure_type.upper() not in sim_measure_types:
        raise TypeError('\'' + sim_measure_type + '\' is not a valid ' + \
                        'sim_measure_type. Supported types are COSINE, DICE' + \
                        ', EDIT_DISTANCE, JACCARD and OVERLAP.')
    return True


def validate_comp_op_for_sim_measure(comp_op, sim_measure_type):
    """Check if the comparison operator is valid for the sim_measure_type."""
    if sim_measure_type == 'EDIT_DISTANCE':
        if comp_op not in ['<=', '<', '=']:
            raise AssertionError('Comparison operator not supported. ' + \
                'Supported comparison operators for ' + sim_measure_type + \
                ' are <=, < and =.')
    else:
        if comp_op not in ['>=', '>', '=']:
            raise AssertionError('Comparison operator not supported. ' + \
                'Supported comparison operators for ' + sim_measure_type + \
                ' are >=, > and =.')
    return True


def validate_comp_op(comp_op):
    """Check if the comparison operator is valid."""

# Path: py_stringsimjoin/utils/generic_helper.py
# COMP_OP_MAP = {'>=': operator.ge,
#                '>': operator.gt,
#                '<=': operator.le,
#                '<': operator.lt,
#                '=': operator.eq,
#                '!=': operator.ne}


# Path: py_stringsimjoin/utils/validation.py
import os
import numpy as np
import pandas as pd
from py_stringmatching.tokenizer.tokenizer import Tokenizer
from py_stringmatching.tokenizer.qgram_tokenizer import QgramTokenizer
from py_stringsimjoin.utils.generic_helper import COMP_OP_MAP



def validate_sim_measure_type(sim_measure_type):
    """Check if the input sim_measure_type is one of the supported types."""
    sim_measure_types = ['COSINE', 'DICE', 'EDIT_DISTANCE', 'JACCARD',
                         'OVERLAP']
    if sim_measure_type.upper() not in sim_measure_types:
        raise TypeError('\'' + sim_measure_type + '\' is not a valid ' + \
                        'sim_measure_type. Supported types are COSINE, DICE' + \
                        ', EDIT_DISTANCE, JACCARD and OVERLAP.')
    return True


def validate_comp_op_for_sim_measure(comp_op, sim_measure_type):
    """Check if the comparison operator is valid for the sim_measure_type."""
    if sim_measure_type == 'EDIT_DISTANCE':
        if comp_op not in ['<=', '<', '=']:
            raise AssertionError('Comparison operator not supported. ' + \
                'Supported comparison operators for ' + sim_measure_type + \
                ' are <=, < and =.')
    else:
        if comp_op not in ['>=', '>', '=']:
            raise AssertionError('Comparison operator not supported. ' + \
                'Supported comparison operators for ' + sim_measure_type + \
                ' are >=, > and =.')
    return True


def validate_comp_op(comp_op):
    """Check if the comparison operator is valid."""

    if comp_op not in COMP_OP_MAP.keys():