Skip to content

Commit 978f640

Browse files
author
Sean Trott
committed
Specializer
1 parent a9f84e1 commit 978f640

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

-16 Bytes
Binary file not shown.
-18 Bytes
Binary file not shown.

src/main/nluas/language/core_specializer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def specialize(self, fs):
8080
#else:
8181
#parameters = self.fill_parameters(eventProcess)
8282
#ntuple['parameters'] = [parameters]
83-
print(ntuple['eventDescriptor'])
8483
parameters = ntuple['eventDescriptor']['eventProcess']
8584
if mood == "wh_question":
8685
ntuple['return_type'], ntuple['eventDescriptor']['eventProcess']['specificWh'] = self.get_return_type(parameters)

src/main/nluas/language/user_agent.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,23 @@ def process_input(self, msg):
7474
except Exception as e:
7575
print(e)
7676

77-
def output_stream(self, message):
77+
def output_stream(self, tag, message):
7878
# Should actually just print to self._out
79-
print(message)
79+
print("{}: {}".format(tag, message))
8080

8181
def callback(self, ntuple):
8282
ntuple = self.decoder.convert_JSON_to_ntuple(ntuple)
8383
call_type = ntuple['type']
8484
if call_type == "failure":
85-
self.output_stream("{}: {}".format(ntuple['tag'], ntuple['message']))
85+
self.output_stream(ntuple['tag'], ntuple['message'])
8686
#print(ntuple['message'])
8787
elif call_type == "clarification":
8888
#self.output_stream("{}: {}".format(ntuple['tag'], ntuple['message']))
89-
output = "{}: {}".format(ntuple['tag'], ntuple['message'])
9089
#self.prompt(clarification=True, ntuple=ntuple['ntuple'])
91-
self.process_clarification(output, ntuple['ntuple'])
90+
self.process_clarification(ntuple['tag'], ntuple['message'], ntuple['ntuple'])
9291
#print(ntuple['ntuple'])
9392
elif call_type == "response":
94-
self.output_stream("{}: {}".format(ntuple['tag'], ntuple['message']))
93+
self.output_stream(ntuple['tag'], ntuple['message'])
9594
#print(ntuple)
9695
#decoded = self.decoder.convert_JSON_to_ntuple(ntuple)
9796
#print(decoded)
@@ -121,8 +120,8 @@ def prompt(self):
121120

122121

123122

124-
def process_clarification(self, msg, ntuple):
125-
self.output_stream(msg)
123+
def process_clarification(self, tag, msg, ntuple):
124+
self.output_stream(tag, msg)
126125
#msg = input(msg + "> ")
127126
new = self.decoder.convert_JSON_to_ntuple(ntuple)
128127
#print(new)

0 commit comments

Comments
 (0)