From 88e579ea30ecee036a0b39111b4bc9789a5fb559 Mon Sep 17 00:00:00 2001 From: Benoit Chevallier-Mames Date: Fri, 5 Jul 2024 17:48:46 +0200 Subject: [PATCH] docs(frontend): making an Alphabet class --- .../examples/levenshtein_distance/levenshtein_distance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py b/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py index eb2a9ddeb1..9e4c9d6f84 100644 --- a/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py +++ b/frontends/concrete-python/examples/levenshtein_distance/levenshtein_distance.py @@ -81,7 +81,7 @@ def compile_module(self, args): min_max_strategy_preference=fhe.MinMaxStrategy.ONE_TLU_PROMOTED, ) - def check_string_is_in_alphabet(string): + def check_string_is_in_alphabet(self, string): """Check a string is a valid string of an alphabet.""" assert len(self.mapping_to_int) > 0, "Mapping not defined" @@ -341,7 +341,7 @@ def main(): # Do what the user requested if args.autotest: myalphabet = Alphabet() - myalphabet.set_alphabet(alphabet) + myalphabet.set_alphabet(args.alphabet) myalphabet.compile_module(args) list_patterns = myalphabet.prepare_random_patterns(0, args.max_string_length, 1) @@ -376,7 +376,7 @@ def main(): ) myalphabet = Alphabet() - myalphabet.set_alphabet(alphabet, verbose=False) + myalphabet.set_alphabet(args.alphabet, verbose=False) myalphabet.compile_module(args) myalphabet.check_string_is_in_alphabet(args.distance[0])