In [1]:
from xv.english import LearnLanguageManager
In [2]:
ke = LearnLanguageManager(verbose = False,
author = 'Thakur')
In [3]:
ke.printProblemTypes()
In [4]:
text = """
Hello, How do you do?
"""
In [5]:
ke.getRandomProblem(problem_type = 0,
dest = 'hi',
#text = text.strip()
)
Out[5]:
In [6]:
ke.listen()
Out[6]:
In [7]:
ke.printAnswer()
Out[7]:
In [8]:
ke.printSolution()
Out[8]:
In [9]:
from IPython.display import HTML
n = len(ke._problemTemplates)
max_loop = 1
for j in range(0, max_loop):
for i in range(n):
problem_type = i
display(HTML(f"<h2>problem_type: {problem_type}/{n-1} (loop {j}/{max_loop-1})</h2>"))
ke.getRandomProblem(problem_type = problem_type, verbose = True)
display(ke.printProblem())
display(HTML(f"<h6>Answer:</h6>"))
display(ke.printAnswer())
display(HTML(f"<h6>Solution:</h6>"))
display(ke.printSolution())
pass
In [ ]: