6.6 KiB
6.6 KiB
from DST import Dst
from AJN import *
from NLG import nlg
if __name__ == "__main__":
dst = Dst()
next_question = dst.get_next_question()
while (next_question):
text = input('>>>')
frame = ajn(text)
dst.save_answer(frame['slots'])
next_question = dst.get_next_question()
print(next_question)
print(dst.checklist)
# print(frame['act'])
nlg(next_question)
>>> chce 2 bilety
tytul {'ilosc': '2', 'tytul': None, 'dzien': None, 'godzina': None} Na jaki film ma zostać dokonana rezerwacja?
>>> chce na film batman
ilosc {'ilosc': None, 'tytul': 'Batman', 'dzien': None, 'godzina': None} Ile biletów ma zostać zarezerwowanych?
>>> chce 2 bilety
tytul {'ilosc': '2', 'tytul': None, 'dzien': None, 'godzina': None} Na jaki film ma zostać dokonana rezerwacja?
>>> chce 2 bilety na film batman
dzien {'ilosc': '2', 'tytul': 'Batman', 'dzien': None, 'godzina': None} Na który dzień ma być dokonana rezerwacja?
>>> chce na jutro
ilosc {'ilosc': None, 'tytul': None, 'dzien': 'jutro', 'godzina': None} Ile biletów ma zostać zarezerwowanych?
[0;31m---------------------------------------------------------------------------[0m [0;31mKeyboardInterrupt[0m Traceback (most recent call last) [0;32m<ipython-input-2-0b584a7b5a30>[0m in [0;36m<module>[0;34m[0m [1;32m 12[0m [0;34m[0m[0m [1;32m 13[0m [0;34m[0m[0m [0;32m---> 14[0;31m [0mtext[0m [0;34m=[0m [0minput[0m[0;34m([0m[0;34m'>>>'[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 15[0m [0mframe[0m [0;34m=[0m [0majn[0m[0;34m([0m[0mtext[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 16[0m [0;34m[0m[0m [0;32m/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py[0m in [0;36mraw_input[0;34m(self, prompt)[0m [1;32m 849[0m [0mself[0m[0;34m.[0m[0m_parent_ident[0m[0;34m,[0m[0;34m[0m[0;34m[0m[0m [1;32m 850[0m [0mself[0m[0;34m.[0m[0m_parent_header[0m[0;34m,[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 851[0;31m [0mpassword[0m[0;34m=[0m[0;32mFalse[0m[0;34m,[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 852[0m ) [1;32m 853[0m [0;34m[0m[0m [0;32m/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py[0m in [0;36m_input_request[0;34m(self, prompt, ident, parent, password)[0m [1;32m 890[0m [0;32mexcept[0m [0mKeyboardInterrupt[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 891[0m [0;31m# re-raise KeyboardInterrupt, to truncate traceback[0m[0;34m[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 892[0;31m [0;32mraise[0m [0mKeyboardInterrupt[0m[0;34m([0m[0;34m"Interrupted by user"[0m[0;34m)[0m [0;32mfrom[0m [0;32mNone[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 893[0m [0;32mexcept[0m [0mException[0m [0;32mas[0m [0me[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 894[0m [0mself[0m[0;34m.[0m[0mlog[0m[0;34m.[0m[0mwarning[0m[0;34m([0m[0;34m"Invalid Message:"[0m[0;34m,[0m [0mexc_info[0m[0;34m=[0m[0;32mTrue[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;31mKeyboardInterrupt[0m: Interrupted by user