Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Jun 27, 2023
1 parent c88bc07 commit 30fced2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
8 changes: 0 additions & 8 deletions opteryx/third_party/README.md

This file was deleted.

7 changes: 2 additions & 5 deletions opteryx/third_party/mbleven.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ def compare(str1: str, str2: str) -> int:
def check_model(str1: str, str2: str, len1: int, len2: int, model) -> int:
"""Check if the model can transform str1 into str2"""

idx1, idx2 = 0, 0
cost, pad = 0, 0
cost, idx1, idx2 = 0, 0, 0
while idx1 < len1 and idx2 < len2:
if str1[idx1] != str2[idx2 - pad]:
if str1[idx1] != str2[idx2]:
cost += 1
if cost > 2:
return cost
Expand All @@ -90,10 +89,8 @@ def check_model(str1: str, str2: str, len1: int, len2: int, model) -> int:
elif option == REPLACE:
idx1 += 1
idx2 += 1
pad = 0
else:
idx1 += 1
idx2 += 1
pad = 0

return cost + (len1 - idx1) + (len2 - idx2)
6 changes: 1 addition & 5 deletions opteryx/utils/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,4 @@ def _replacer(match):
formatted_sql = formatted_sql.replace(" \033[38;5;102m,", "\033[38;5;102m,")
formatted_sql = formatted_sql.replace(" \033[38;5;102m;", "\033[38;5;102m;")

return (
color_comments(formatted_sql)
.strip()
.replace("\n", " \033[7;38;2;98;114;164m\033[3m↵\033[0m ")
)
return color_comments(formatted_sql).strip()

0 comments on commit 30fced2

Please sign in to comment.