Skip to content

Commit

Permalink
removed some redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentBlanckaert committed Dec 19, 2024
1 parent b9786c2 commit c63e391
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tested/nat_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ def parse_value(
return value


def get_replacement(language: str, translation_stack: list, match: re.Match) -> str:
word = match.group(1)
current = -1
stack = translation_stack[current]
while abs(current) <= len(translation_stack) and word not in stack:
current -= 1
stack = translation_stack[current]
if abs(current) <= len(translation_stack):
translations = stack[word]
assert language in translations
word = translations[language]

return word


def flatten_stack(translation_stack: list, language: str) -> dict:
flattened = {}
for d in translation_stack:
Expand Down

0 comments on commit c63e391

Please sign in to comment.