Move pieces of parsing code in parsing module.
This commit is contained in:
parent
3cc1f9bcde
commit
ad975015a6
3 changed files with 5 additions and 4 deletions
|
@ -67,6 +67,7 @@ def reprocess_language_knowledge(knowledge_base, examples):
|
|||
|
||||
|
||||
def get_fit(knowledge, row):
|
||||
row = row.lower().split()
|
||||
for sample, ast in knowledge.trained:
|
||||
if len(sample) != len(row):
|
||||
continue
|
||||
|
@ -74,6 +75,6 @@ def get_fit(knowledge, row):
|
|||
if all(map(lambda x: (not isinstance(sample[x], str)
|
||||
or sample[x] == row[x]),
|
||||
range(len(sample)))):
|
||||
return sample, ast
|
||||
return row, sample, ast
|
||||
else:
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue