X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/837d44391c00348c4bc2a39d155d1d1473676285..a6dab5e300de9c5664f714eb2c9290d18f01067f:/nominatim/tokenizer/icu_token_analysis.py?ds=sidebyside diff --git a/nominatim/tokenizer/icu_token_analysis.py b/nominatim/tokenizer/icu_token_analysis.py index ee3144a8..68fc82e3 100644 --- a/nominatim/tokenizer/icu_token_analysis.py +++ b/nominatim/tokenizer/icu_token_analysis.py @@ -27,3 +27,10 @@ class ICUTokenAnalysis: self.analysis = {name: arules.create(self.normalizer, self.to_ascii, arules.config) for name, arules in analysis_rules.items()} + + + def get_analyzer(self, name): + """ Return the given named analyzer. If no analyzer with that + name exists, return the default analyzer. + """ + return self.analysis.get(name) or self.analysis[None]