Commit 5a992987 authored by Theresa Pollinger's avatar Theresa Pollinger
Browse files

bits and pieces improved; user can now add properties to operators

parent 6ae131b6
......@@ -49,6 +49,9 @@ class Interview(cmd.Cmd):
arg = LatexNodes2Text().latex_to_text(raw)
# pythonic switch-case, cf. https://bytebaker.com/2008/11/03/switch-case-statement-in-python/
if arg.startswith("explain"):
return self.state_machine.explain()
if not self.prompt_input_handling(arg):
self.state_input_handling(arg)
......@@ -92,15 +95,6 @@ class Interview(cmd.Cmd):
return True
return False
# called when user types 'explain [expression]'
def do_explain(self, expression):
"Explain an expression or the theoretical background to what we are currently looking for"
if expression:
explanation = "hello, " + expression # TODO query flexiformal content through mmt
else:
explanation = 'hello'
self.poutput(explanation)
def help_explain(self):
self.poutput('\n'.join(['explain [expression]',
'explain the expression given or the theory currently used',
......
......@@ -142,7 +142,7 @@ class MMTInterface:
self.extension = ':interview'
self.URIprefix = 'http://mathhub.info/'
self.namespace = 'MitM/smglom/calculus' # TODO
self.debugprint = False
self.debugprint = True
# try:
# _thread.start_new_thread(run_mmt_server, ())
# except:
......@@ -206,7 +206,9 @@ class MMTInterface:
return MMTReply(False, root)
def get_mpath(self, thyname):
mpath = self.URIprefix + self.namespace + "?" + thyname # TODO
mpath = thyname
if not (mpath.startswith("http://") or mpath.startswith("https://")):
mpath = self.URIprefix + self.namespace + "?" + thyname # TODO
return mpath
def query_for(self, thingname):
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment