handle unknown analyzer

When changing something in the default configuration of the sanatizers
that refers to an analyzer that is not yet loaded, there shouldn't be
any errors.
This commit is contained in:
Sarah Hoffmann
2022-02-15 14:38:03 +01:00
parent 837d44391c
commit 0bb59b2e22
2 changed files with 8 additions and 1 deletions

View File

@@ -561,7 +561,7 @@ class LegacyICUNameAnalyzer(AbstractAnalyzer):
for name in names:
analyzer_id = name.get_attr('analyzer')
analyzer = self.token_analysis.analysis[analyzer_id]
analyzer = self.token_analysis.get_analyzer(analyzer_id)
norm_name = analyzer.normalize(name.name)
if analyzer_id is None:
token_id = norm_name