Skip to content

Commit

Permalink
litle changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gras64 committed Dec 27, 2020
1 parent 5d9c979 commit f543c0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 2 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def add_category(self, cat):
path = self.file_system.path + "/category/"+ self.lang
Category = self.get_response("add.category",
data={"cat": cat})
if not os.path.isdir(path):
os.makedirs(path)
makedirs(path, exist_ok=True)
save_category = open(path +"/"+ cat+'.voc', "w")
save_category.write(cat)
save_category.close()
Expand Down Expand Up @@ -209,8 +208,7 @@ def handle_learning(self, message, Category=None, saved_utt=None):
self.write_file(question_path, question, keywords.replace(" ", ".")+".intent")

def write_file(self, path, data, filename):
if not os.path.isdir(path):
os.makedirs(path)
makedirs(path, exist_ok=True)
save_dialog = open(path+filename, "a")
save_dialog.write(data+"\n")
save_dialog.close()
Expand Down
3 changes: 3 additions & 0 deletions vocab/de-de/cancel.voc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
abbrechen
halt
exit
stop
5 changes: 4 additions & 1 deletion vocab/en-us/cancel.voc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
cancel
abort
stop
exit
stop

0 comments on commit f543c0c

Please sign in to comment.