def __init__(self, tokenizer, sim_measure_type, threshold): # check if the input tokenizer is valid validate_tokenizer(tokenizer) # check if the sim_measure_type is valid validate_sim_measure_type(sim_measure_type) # check if the threshold is valid validate_threshold(threshold, sim_measure_type) self.tokenizer = tokenizer self.sim_measure_type = sim_measure_type self.threshold = threshold super(self.__class__, self).__init__()
def __init__(self, tokenizer, sim_measure_type, threshold, allow_empty=True, allow_missing=False): # check if the sim_measure_type is valid validate_sim_measure_type(sim_measure_type) sim_measure_type = sim_measure_type.upper() # check if the input tokenizer is valid validate_tokenizer_for_sim_measure(tokenizer, sim_measure_type) # check if the threshold is valid validate_threshold(threshold, sim_measure_type) self.tokenizer = tokenizer self.sim_measure_type = sim_measure_type self.threshold = threshold self.allow_empty = allow_empty super(self.__class__, self).__init__(allow_missing)
def __init__(self, tokenizer, sim_measure_type, threshold, allow_empty=True, allow_missing=False): # check if the sim_measure_type is valid validate_sim_measure_type(sim_measure_type) sim_measure_type = sim_measure_type.upper() # check if the input tokenizer is valid validate_tokenizer_for_sim_measure(tokenizer, sim_measure_type) # check if the threshold is valid validate_threshold(threshold, sim_measure_type) self.tokenizer = tokenizer self.sim_measure_type = sim_measure_type self.threshold = threshold self.allow_empty = allow_empty super(self.__class__, self).__init__(allow_missing)