Fixed minor issues and enhancements

This commit is contained in:
2020-05-15 17:01:26 +02:00
parent b54882f994
commit 56e0a9d338
8 changed files with 59 additions and 13 deletions
+4 -2
View File
@@ -11,7 +11,7 @@ class ExactConceptParser(BaseParser):
Tries to recognize a single concept
"""
MAX_WORDS_SIZE = 3
MAX_WORDS_SIZE = 6
def __init__(self, max_word_size=None, **kwargs):
BaseParser.__init__(self, "ExactConcept", 80)
@@ -36,7 +36,9 @@ class ExactConceptParser(BaseParser):
if len(words) > (self.max_word_size or self.MAX_WORDS_SIZE):
context.log(f"Max words reached. Stopping.", self.name)
return sheerka.ret(self.name, False, sheerka.new(BuiltinConcepts.CONCEPT_TOO_LONG, body=parser_input))
too_long = sheerka.new(BuiltinConcepts.CONCEPT_TOO_LONG, body=parser_input)
body = sheerka.new(BuiltinConcepts.NOT_FOR_ME, body=parser_input, reason=too_long)
return sheerka.ret(self.name, False, body)
recognized = [] # keep track of the concepts founds
for combination in self.combinations(words):