introduce name analyzer

The name analyzer is the actual work horse of the tokenizer. It
is instantiated on a thread-base and provides all functions for
analysing names and queries.
This commit is contained in:
Sarah Hoffmann
2021-04-24 22:35:46 +02:00
parent e1c5673ac3
commit fa2bc60468
5 changed files with 113 additions and 23 deletions

View File

@@ -23,3 +23,30 @@ class DummyTokenizer:
def init_from_project(self):
assert self.init_state == None
self.init_state = "loaded"
def name_analyzer(self):
return DummyNameAnalyzer()
class DummyNameAnalyzer:
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()
def close(self):
""" Free all resources used by the analyzer.
"""
pass
def process_place(self, place):
""" Determine tokenizer information about the given place.
Returns a JSON-serialisable structure that will be handed into
the database via the token_info field.
"""
return {}