From ad80f8c4150282c98623e9cd582d1dfe97304e36 Mon Sep 17 00:00:00 2001 From: Gunther Cox Date: Sat, 5 Nov 2016 09:19:43 -0400 Subject: [PATCH] Don't overide get method on ApproximateSentenceMatchAdapter --- .../logic/approximate_sentence_match.py | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/chatterbot/adapters/logic/approximate_sentence_match.py b/chatterbot/adapters/logic/approximate_sentence_match.py index 7f9ce6c2d..6c2065f5c 100644 --- a/chatterbot/adapters/logic/approximate_sentence_match.py +++ b/chatterbot/adapters/logic/approximate_sentence_match.py @@ -11,29 +11,4 @@ def __init__(self, **kwargs): self.compare_statements = kwargs.get( 'statement_comparison_function', jaccard_similarity - ) - - def get(self, input_statement): - """ - Takes a statement string and a list of statement strings. - Returns the closest matching statement from the list. - """ - statement_list = self.context.storage.get_response_statements() - - if not statement_list: - if self.has_storage_context: - # Use a randomly picked statement - return 0, self.context.storage.get_random() - else: - raise self.EmptyDatasetException() - - confidence = -1 - sentence_match = input_statement - # Find the matching known statement - for statement in statement_list: - ratio = self.compare_statements(input_statement, statement) - if ratio: - closest_match = statement - else: - closest_match = statement - return 0.5, closest_match + ) \ No newline at end of file