Added support for "what day are we"
This commit is contained in:
parent
cae27505fc
commit
db13666d57
@ -2,6 +2,7 @@ import os
|
||||
|
||||
import torch
|
||||
from unidecode import unidecode
|
||||
|
||||
import get_path_file
|
||||
from ia.model import NeuralNet
|
||||
from ia.nltk_utils import bag_of_words, tokenize
|
||||
|
Binary file not shown.
@ -1,12 +1,14 @@
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
import utils.intents_utils
|
||||
from utils import config_utils
|
||||
from utils import config_utils, intents_utils
|
||||
|
||||
|
||||
def what_time_is_it():
|
||||
tag = 'what_time_is_it'
|
||||
response = intents_utils.get_response(tag)
|
||||
|
||||
current_time = time.localtime()
|
||||
response = utils.intents_utils.get_response("what_time_is_it")
|
||||
|
||||
if config_utils.get_in_config("12HOURS-FORMAT"):
|
||||
response = response.replace('{time}', time.strftime("%I:%M %p", current_time))
|
||||
@ -17,4 +19,12 @@ def what_time_is_it():
|
||||
|
||||
|
||||
def what_day_is_it():
|
||||
return ""
|
||||
tag = 'what_day_is_it'
|
||||
response = intents_utils.get_response(tag)
|
||||
|
||||
day_number = datetime.today().weekday()
|
||||
lang_json = intents_utils.get_lang_for_intent('what_day_is_it')['others']['days_of_week']
|
||||
|
||||
response = response.replace('{day}', lang_json[str(day_number)])
|
||||
|
||||
return response
|
||||
|
@ -19,9 +19,20 @@
|
||||
"Tell me the day of the week. ",
|
||||
"What day are we"
|
||||
],
|
||||
"response": [
|
||||
"responses": [
|
||||
"{day}",
|
||||
"Today is {day}"
|
||||
]
|
||||
},
|
||||
"others": {
|
||||
"days_of_week": {
|
||||
"0": "Monday",
|
||||
"1": "Tuesday",
|
||||
"2": "Wednesday",
|
||||
"3": "Thursday",
|
||||
"4:": "Friday",
|
||||
"5": "Saturday",
|
||||
"6": "Sunday"
|
||||
}
|
||||
}
|
||||
}
|
@ -17,10 +17,22 @@
|
||||
"Quel jour est-on",
|
||||
"C'est quel jour aujourd'hui"
|
||||
],
|
||||
"response": [
|
||||
"Nous somme le {day}",
|
||||
"responses": [
|
||||
"Nous somme {day}",
|
||||
"Aujourd'hui nous sommes {day}",
|
||||
"On est {day}"
|
||||
"On est {day}",
|
||||
"{day}"
|
||||
]
|
||||
},
|
||||
"others": {
|
||||
"days_of_week": {
|
||||
"0": "Lundi",
|
||||
"1": "Mardi",
|
||||
"2": "Mercredi",
|
||||
"3": "Jeudi",
|
||||
"4:": "Vendredi",
|
||||
"5": "Samedi",
|
||||
"6": "Dimanche"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user