Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentence compare alternate impl #1612

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
8 changes: 5 additions & 3 deletions chatterbot/chatterbot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
from chatterbot.storage import StorageAdapter
from chatterbot.logic import LogicAdapter
from chatterbot.search import IndexedTextSearch
from chatterbot.conversation import Statement
from chatterbot.search import IndexedTextSearch
from chatterbot import utils


Expand All @@ -14,7 +14,9 @@ class ChatBot(object):
def __init__(self, name, **kwargs):
self.name = name

primary_search_algorithm = IndexedTextSearch(self, **kwargs)
search_algo = kwargs.get('primary_search_algorithm', 'chatterbot.search.IndexedTextSearch')

primary_search_algorithm = utils.initialize_class(search_algo, chatbot=self, **kwargs)

self.search_algorithms = {
primary_search_algorithm.name: primary_search_algorithm
Expand All @@ -36,7 +38,7 @@ def __init__(self, name, **kwargs):

for adapter in logic_adapters:
utils.validate_adapter_class(adapter, LogicAdapter)
logic_adapter = utils.initialize_class(adapter, self, **kwargs)
logic_adapter = utils.initialize_class(adapter, self, search_algorithm_name=primary_search_algorithm.name, **kwargs)
self.logic_adapters.append(logic_adapter)

preprocessors = kwargs.get(
Expand Down
357 changes: 0 additions & 357 deletions chatterbot/comparisons.py

This file was deleted.

Loading