Skip to content

Commit 39db007

Browse files
committed
Fix the NoneType related errors inside the learning script
1 parent a80a69c commit 39db007

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dragonfire/learn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ def db_getter(self,subject):
8181
first_verbtense = False
8282
for key, value in dictionary.iteritems(): # iterate over the dictionary defined and assigned on above
8383
if not first_verbtense: # if the first verbtense assignment does not made yet
84-
answer += ' ' + key # concatenate with a whitespace
84+
answer += ' ' + str(key) # concatenate with a whitespace
8585
first_verbtense = True
8686
else:
87-
answer += ', ' + key # otherwise concatenate with a comma + whitespace
87+
answer += ', ' + str(key) # otherwise concatenate with a comma + whitespace
8888
first_clause = False
8989
for clause in value: # iterate over the clauses of the key
9090
if not first_clause: # if the first verbtense assignment does not made yet
@@ -117,7 +117,8 @@ def mirror(self,answer):
117117
def pronoun_fixer(self,subject): # TODO: Extend the context of this function
118118
subject = subject.upper()
119119
if 'YOURSELF' in subject:
120-
return subject.replace('YOURSELF','YOU')
120+
subject = subject.replace('YOURSELF','YOU')
121+
return subject
121122

122123

123124
if __name__ == "__main__":

0 commit comments

Comments
 (0)