Add remix application sample.

This commit is contained in:
kenkeiras 2017-05-13 20:33:09 +02:00
parent c6eaf056aa
commit 099af2a815

View File

@ -63,6 +63,10 @@ def integrate_language(knowledge_base, example):
print("Tx:", tokens)
print("Mx:", matcher)
print("Rx:", result)
print("Remix:", remix)
after_remix = apply_remix(tokens[len(start_bounds):-len(end_bounds)], remix)
assert(len(after_remix) + len(start_bounds) + len(end_bounds) == len(tokens))
print(" \\->", after_remix)
print("#########")
break
@ -75,6 +79,13 @@ def integrate_language(knowledge_base, example):
return tokens, matcher, result
def apply_remix(tokens, remix):
rebuilt = []
for i in remix:
rebuilt.append(tokens[i])
return rebuilt
def build_remix_matrix(knowledge_base, text, atom, similar):
# print("+" * 20)