Skip to content

Commit

Permalink
refactor(jinja): ♻️ Change filter definition
Browse files Browse the repository at this point in the history
  • Loading branch information
egalvis39 committed Aug 30, 2023
1 parent bab0185 commit 8b7da71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions menuflow/jinja/jinja_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@
"""

jinja_env.globals.update(
compare_ratio=lambda result_text, text, ratio: fuzz.ratio(result_text.lower(), text.lower())
>= ratio
compare_ratio=lambda text, base_text: fuzz.ratio(text.lower(), base_text.lower())
)
"""
Validates if a text is similar to another text
e.g
{{ compare_ratio("Esteban Galvis", "Esteban Galvis Triana", 80) }}
{{ compare_ratio("Esteban Galvis", "Esteban Galvis Triana") }}
"""

0 comments on commit 8b7da71

Please sign in to comment.