Added concepts with the same key handling
This commit is contained in:
@@ -32,14 +32,16 @@ class ExactConceptParser(BaseParser):
|
||||
|
||||
recognized = False
|
||||
for combination in self.combinations(words):
|
||||
concept_key = " ".join(combination)
|
||||
|
||||
# Very important question to think about later
|
||||
# Must we return a new instance or the existing one
|
||||
# That will depend on the context
|
||||
# Let's return a new one for now and see if it works
|
||||
concept = sheerka.new(concept_key)
|
||||
if not sheerka.isinstance(concept, BuiltinConcepts.UNKNOWN_CONCEPT):
|
||||
concept_key = " ".join(combination)
|
||||
result = sheerka.new(concept_key)
|
||||
|
||||
if sheerka.isinstance(result, BuiltinConcepts.UNKNOWN_CONCEPT):
|
||||
continue
|
||||
|
||||
concepts = result.body if sheerka.isinstance(result, BuiltinConcepts.ENUMERATION) else [result]
|
||||
|
||||
for concept in concepts:
|
||||
# update the properties if needed
|
||||
for i, token in enumerate(combination):
|
||||
if token.startswith(Concept.PROPERTY_PREFIX):
|
||||
|
||||
Reference in New Issue
Block a user