This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
153 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Grammar\n", | ||
"\n", | ||
"The chatbot relies on a grammar to interpret an order. By default, it interprets French." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"[('MOKADI', ':MOKADI:'),\n", | ||
" ('lire', ':verb_voir:'),\n", | ||
" ('mail', ':mails:'),\n", | ||
" ('<EOF>', ':P:')]" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from botadi.mokadi import interpret\n", | ||
"cmd = \"MOKADI lire mail\"\n", | ||
"interpret(cmd)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"[('MOKADI', ':MOKADI:'),\n", | ||
" ('lire', ':verb_voir:'),\n", | ||
" ('pr\u00e9sentation', ':presentation:'),\n", | ||
" ('1', ':int:'),\n", | ||
" ('transparent', ':slide:'),\n", | ||
" ('num\u00e9ro', ':numero:'),\n", | ||
" ('2', ':int:'),\n", | ||
" ('<EOF>', ':P:')]" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"cmd = \"MOKADI lire pr\u00e9sentation 1 transparent num\u00e9ro 2\"\n", | ||
"interpret(cmd)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@brief test log(time=5s) | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
from pyquickhelper.loghelper import fLOG | ||
from pyquickhelper.pycode import add_missing_development_version | ||
from pyquickhelper.ipythonhelper import test_notebook_execution_coverage | ||
|
||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
import src.botadi | ||
|
||
|
||
class TestNotebookGrammar(unittest.TestCase): | ||
|
||
def setUp(self): | ||
add_missing_development_version(["jyquickhelper"], __file__, hide=True) | ||
|
||
def test_notebook_grammar(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
|
||
self.assertTrue(src.botadi is not None) | ||
folder = os.path.join(os.path.dirname(__file__), | ||
"..", "..", "_doc", "notebooks") | ||
test_notebook_execution_coverage( | ||
__file__, "grammar", folder, 'botadi', copy_files=[], fLOG=fLOG) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters