Skip to content

Commit

Permalink
Move imports to top of conversation file
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Nov 10, 2018
1 parent 9f3a53d commit 6fc8243
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions chatterbot/conversation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from datetime import datetime
from dateutil import parser as date_parser


class StatementMixin(object):
"""
This class has shared methods used to
Expand Down Expand Up @@ -41,24 +45,12 @@ class Statement(StatementMixin):
"""

def __init__(self, **kwargs):
from datetime import datetime
from dateutil import parser as date_parser

# Try not to allow non-string types to be passed to statements
try:
text = str(kwargs.get('text'))
except UnicodeEncodeError:
pass

self.id = kwargs.get('id')

self.text = text
self.text = str(kwargs.get('text'))
self.search_text = kwargs.get('search_text', '')

self.conversation = kwargs.get('conversation', '')

self.persona = kwargs.get('persona', '')

self.tags = kwargs.pop('tags', [])
self.in_response_to = kwargs.pop('in_response_to', None)
self.search_in_response_to = kwargs.get('search_in_response_to', '')
Expand Down

0 comments on commit 6fc8243

Please sign in to comment.