Added simple form of concept composition
This commit is contained in:
@@ -37,6 +37,10 @@ class PythonWithConceptsParser(BaseParser):
|
||||
|
||||
def _get_identifier(c):
|
||||
"""
|
||||
Get an identifier for a concept.
|
||||
Make sure to return the same identifier if the same concept
|
||||
Make sure to return a different identifier if same name but different concept
|
||||
|
||||
Internal function because I don't want identifiers, identifiers_key and python_ids_mappings
|
||||
to be instance variables
|
||||
I would like to keep this parser as stateless as possible
|
||||
@@ -99,14 +103,3 @@ class PythonWithConceptsParser(BaseParser):
|
||||
self.name,
|
||||
False,
|
||||
result.body)
|
||||
|
||||
def concept_identifier(self, concept):
|
||||
if id(concept) in self.identifiers:
|
||||
return self.identifiers[id(concept)]
|
||||
|
||||
identifier = "__C__" + (concept.key or concept.name)
|
||||
if concept.id:
|
||||
identifier += "__" + concept.id
|
||||
identifier += "__C__"
|
||||
|
||||
return identifier
|
||||
|
||||
Reference in New Issue
Block a user