From 1cde8566611f7ef72a0c496a268071048ea77bdf Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:37:52 -0400 Subject: [PATCH] proper import --- chatter/chatterbot/comparisons.py | 2 +- chatter/chatterbot/ext/sqlalchemy_app/models.py | 10 +++++----- chatter/chatterbot/input/gitter.py | 4 ++-- chatter/chatterbot/input/hipchat.py | 4 ++-- chatter/chatterbot/input/input_adapter.py | 2 +- chatter/chatterbot/input/mailgun.py | 4 ++-- chatter/chatterbot/input/microsoft.py | 4 ++-- chatter/chatterbot/input/terminal.py | 6 +++--- .../input/variable_input_type_adapter.py | 4 ++-- chatter/chatterbot/logic/logic_adapter.py | 8 ++++---- chatter/chatterbot/logic/low_confidence.py | 2 +- .../chatterbot/logic/mathematical_evaluation.py | 4 ++-- chatter/chatterbot/logic/multi_adapter.py | 2 +- chatter/chatterbot/logic/specific_response.py | 2 +- chatter/chatterbot/logic/time_adapter.py | 2 +- chatter/chatterbot/output/output_adapter.py | 2 +- chatter/chatterbot/storage/mongodb.py | 6 +++--- chatter/chatterbot/storage/sql_storage.py | 16 ++++++++-------- chatter/chatterbot/utils.py | 2 +- 19 files changed, 43 insertions(+), 43 deletions(-) diff --git a/chatter/chatterbot/comparisons.py b/chatter/chatterbot/comparisons.py index 43cda14..3abc009 100644 --- a/chatter/chatterbot/comparisons.py +++ b/chatter/chatterbot/comparisons.py @@ -125,7 +125,7 @@ class SynsetDistance(Comparator): """ from nltk.corpus import wordnet from nltk import word_tokenize - from chatterbot import utils + from chatter.chatterbot import utils import itertools tokens1 = word_tokenize(statement.text.lower()) diff --git a/chatter/chatterbot/ext/sqlalchemy_app/models.py b/chatter/chatterbot/ext/sqlalchemy_app/models.py index ae08193..41a05c0 100644 --- a/chatter/chatterbot/ext/sqlalchemy_app/models.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/models.py @@ -1,6 +1,6 @@ -from chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH -from chatterbot.conversation import StatementMixin -from chatterbot.ext.sqlalchemy_app.types import UnicodeString +from chatter.chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH +from chatter.chatterbot.conversation import StatementMixin +from chatter.chatterbot.ext.sqlalchemy_app.types import UnicodeString from sqlalchemy import Table, Column, Integer, DateTime, ForeignKey, PickleType from sqlalchemy.ext.declarative import declared_attr, declarative_base from sqlalchemy.orm import relationship @@ -72,8 +72,8 @@ class Statement(Base, StatementMixin): return [tag.name for tag in self.tags] def get_statement(self): - from chatterbot.conversation import Statement as StatementObject - from chatterbot.conversation import Response as ResponseObject + from chatter.chatterbot.conversation import Statement as StatementObject + from chatter.chatterbot.conversation import Response as ResponseObject statement = StatementObject( self.text, diff --git a/chatter/chatterbot/input/gitter.py b/chatter/chatterbot/input/gitter.py index 1b6d01f..9018e37 100644 --- a/chatter/chatterbot/input/gitter.py +++ b/chatter/chatterbot/input/gitter.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from time import sleep -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class Gitter(InputAdapter): diff --git a/chatter/chatterbot/input/hipchat.py b/chatter/chatterbot/input/hipchat.py index 70c52bc..b5da731 100644 --- a/chatter/chatterbot/input/hipchat.py +++ b/chatter/chatterbot/input/hipchat.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from time import sleep -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class HipChat(InputAdapter): diff --git a/chatter/chatterbot/input/input_adapter.py b/chatter/chatterbot/input/input_adapter.py index 46fb3a5..49c63db 100644 --- a/chatter/chatterbot/input/input_adapter.py +++ b/chatter/chatterbot/input/input_adapter.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from chatterbot.adapters import Adapter +from chatter.chatterbot.adapters import Adapter class InputAdapter(Adapter): diff --git a/chatter/chatterbot/input/mailgun.py b/chatter/chatterbot/input/mailgun.py index 9807a79..6fb78a8 100644 --- a/chatter/chatterbot/input/mailgun.py +++ b/chatter/chatterbot/input/mailgun.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals import datetime -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class Mailgun(InputAdapter): diff --git a/chatter/chatterbot/input/microsoft.py b/chatter/chatterbot/input/microsoft.py index 3d58dd8..054a9c7 100644 --- a/chatter/chatterbot/input/microsoft.py +++ b/chatter/chatterbot/input/microsoft.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from time import sleep -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class Microsoft(InputAdapter): diff --git a/chatter/chatterbot/input/terminal.py b/chatter/chatterbot/input/terminal.py index 40521d2..20cb3c2 100644 --- a/chatter/chatterbot/input/terminal.py +++ b/chatter/chatterbot/input/terminal.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter -from chatterbot.utils import input_function +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter +from chatter.chatterbot.utils import input_function class TerminalAdapter(InputAdapter): diff --git a/chatter/chatterbot/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py index a93abe9..e08bf53 100644 --- a/chatter/chatterbot/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class VariableInputTypeAdapter(InputAdapter): diff --git a/chatter/chatterbot/logic/logic_adapter.py b/chatter/chatterbot/logic/logic_adapter.py index 68f8088..1239cca 100644 --- a/chatter/chatterbot/logic/logic_adapter.py +++ b/chatter/chatterbot/logic/logic_adapter.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from chatterbot.adapters import Adapter -from chatterbot.utils import import_module +from chatter.chatterbot.adapters import Adapter +from chatter.chatterbot.utils import import_module class LogicAdapter(Adapter): @@ -18,8 +18,8 @@ class LogicAdapter(Adapter): def __init__(self, **kwargs): super(LogicAdapter, self).__init__(**kwargs) - from chatterbot.comparisons import levenshtein_distance - from chatterbot.response_selection import get_first_response + from chatter.chatterbot.comparisons import levenshtein_distance + from chatter.chatterbot.response_selection import get_first_response # Import string module parameters if 'statement_comparison_function' in kwargs: diff --git a/chatter/chatterbot/logic/low_confidence.py b/chatter/chatterbot/logic/low_confidence.py index 2e9dd65..0e3d5d8 100644 --- a/chatter/chatterbot/logic/low_confidence.py +++ b/chatter/chatterbot/logic/low_confidence.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement +from chatter.chatterbot.conversation import Statement from .best_match import BestMatch diff --git a/chatter/chatterbot/logic/mathematical_evaluation.py b/chatter/chatterbot/logic/mathematical_evaluation.py index 02af55e..af27548 100644 --- a/chatter/chatterbot/logic/mathematical_evaluation.py +++ b/chatter/chatterbot/logic/mathematical_evaluation.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement -from chatterbot.logic import LogicAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.logic import LogicAdapter class MathematicalEvaluation(LogicAdapter): diff --git a/chatter/chatterbot/logic/multi_adapter.py b/chatter/chatterbot/logic/multi_adapter.py index 145424a..5e35dfd 100644 --- a/chatter/chatterbot/logic/multi_adapter.py +++ b/chatter/chatterbot/logic/multi_adapter.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from collections import Counter -from chatterbot import utils +from chatter.chatterbot import utils from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/logic/specific_response.py b/chatter/chatterbot/logic/specific_response.py index d3fa38a..101dd3b 100644 --- a/chatter/chatterbot/logic/specific_response.py +++ b/chatter/chatterbot/logic/specific_response.py @@ -16,7 +16,7 @@ class SpecificResponseAdapter(LogicAdapter): def __init__(self, **kwargs): super(SpecificResponseAdapter, self).__init__(**kwargs) - from chatterbot.conversation import Statement + from chatter.chatterbot.conversation import Statement self.input_text = kwargs.get('input_text') diff --git a/chatter/chatterbot/logic/time_adapter.py b/chatter/chatterbot/logic/time_adapter.py index 5047210..b177a67 100644 --- a/chatter/chatterbot/logic/time_adapter.py +++ b/chatter/chatterbot/logic/time_adapter.py @@ -81,7 +81,7 @@ class TimeLogicAdapter(LogicAdapter): return features def process(self, statement): - from chatterbot.conversation import Statement + from chatter.chatterbot.conversation import Statement now = datetime.now() diff --git a/chatter/chatterbot/output/output_adapter.py b/chatter/chatterbot/output/output_adapter.py index 631e343..5d13dd7 100644 --- a/chatter/chatterbot/output/output_adapter.py +++ b/chatter/chatterbot/output/output_adapter.py @@ -1,4 +1,4 @@ -from chatterbot.adapters import Adapter +from chatter.chatterbot.adapters import Adapter class OutputAdapter(Adapter): diff --git a/chatter/chatterbot/storage/mongodb.py b/chatter/chatterbot/storage/mongodb.py index 744d672..06ced53 100644 --- a/chatter/chatterbot/storage/mongodb.py +++ b/chatter/chatterbot/storage/mongodb.py @@ -1,4 +1,4 @@ -from chatterbot.storage import StorageAdapter +from chatter.chatterbot.storage import StorageAdapter class Query(object): @@ -116,7 +116,7 @@ class MongoDatabaseAdapter(StorageAdapter): """ Return the class for the statement model. """ - from chatterbot.conversation import Statement + from chatter.chatterbot.conversation import Statement # Create a storage-aware statement statement = Statement @@ -128,7 +128,7 @@ class MongoDatabaseAdapter(StorageAdapter): """ Return the class for the response model. """ - from chatterbot.conversation import Response + from chatter.chatterbot.conversation import Response # Create a storage-aware response response = Response diff --git a/chatter/chatterbot/storage/sql_storage.py b/chatter/chatterbot/storage/sql_storage.py index ed1153c..32b9535 100644 --- a/chatter/chatterbot/storage/sql_storage.py +++ b/chatter/chatterbot/storage/sql_storage.py @@ -1,8 +1,8 @@ -from chatterbot.storage import StorageAdapter +from chatter.chatterbot.storage import StorageAdapter def get_response_table(response): - from chatterbot.ext.sqlalchemy_app.models import Response + from chatter.chatterbot.ext.sqlalchemy_app.models import Response return Response(text=response.text, occurrence=response.occurrence) @@ -86,28 +86,28 @@ class SQLStorageAdapter(StorageAdapter): """ Return the statement model. """ - from chatterbot.ext.sqlalchemy_app.models import Statement + from chatter.chatterbot.ext.sqlalchemy_app.models import Statement return Statement def get_response_model(self): """ Return the response model. """ - from chatterbot.ext.sqlalchemy_app.models import Response + from chatter.chatterbot.ext.sqlalchemy_app.models import Response return Response def get_conversation_model(self): """ Return the conversation model. """ - from chatterbot.ext.sqlalchemy_app.models import Conversation + from chatter.chatterbot.ext.sqlalchemy_app.models import Conversation return Conversation def get_tag_model(self): """ Return the conversation model. """ - from chatterbot.ext.sqlalchemy_app.models import Tag + from chatter.chatterbot.ext.sqlalchemy_app.models import Tag return Tag def count(self): @@ -379,14 +379,14 @@ class SQLStorageAdapter(StorageAdapter): """ Drop the database attached to a given adapter. """ - from chatterbot.ext.sqlalchemy_app.models import Base + from chatter.chatterbot.ext.sqlalchemy_app.models import Base Base.metadata.drop_all(self.engine) def create(self): """ Populate the database with the tables. """ - from chatterbot.ext.sqlalchemy_app.models import Base + from chatter.chatterbot.ext.sqlalchemy_app.models import Base Base.metadata.create_all(self.engine) def _session_finish(self, session, statement_text=None): diff --git a/chatter/chatterbot/utils.py b/chatter/chatterbot/utils.py index 33c35c1..391a06a 100644 --- a/chatter/chatterbot/utils.py +++ b/chatter/chatterbot/utils.py @@ -130,7 +130,7 @@ def remove_stopwords(tokens, language): Stop words are words like "is, the, a, ..." Be sure to download the required NLTK corpus before calling this function: - - from chatterbot.utils import nltk_download_corpus + - from chatter.chatterbot.utils import nltk_download_corpus - nltk_download_corpus('corpora/stopwords') """ from nltk.corpus import stopwords