Skip to content

Commit ec7b253

Browse files
committed
Lower jaro_distance
1 parent 402cec4 commit ec7b253

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/elixir.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
test:
1111
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-24.04
1313

1414
strategy:
1515
matrix:
@@ -59,12 +59,12 @@ jobs:
5959
- name: Run unit tests
6060
run: |
6161
mix clean
62-
mix test test/absinthe/phase/document/validation/fields_on_correct_type_test.exs:110
62+
mix test
6363
6464
- name: Run unit tests with persistent_term backend
6565
run: |
6666
mix clean
67-
mix test test/absinthe/phase/document/validation/fields_on_correct_type_test.exs:110
67+
mix test
6868
env:
6969
SCHEMA_PROVIDER: persistent_term
7070

lib/absinthe/utils/suggestion.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
defmodule Absinthe.Utils.Suggestion do
2-
@jaro_threshold 0.70
2+
@jaro_threshold 0.60
33

44
@doc """
55
Sort a list of suggestions by Jaro distance to a target string,
@@ -9,7 +9,7 @@ defmodule Absinthe.Utils.Suggestion do
99
def sort_list(suggestions, target, threshold \\ @jaro_threshold)
1010

1111
def sort_list(suggestions, target, threshold) do
12-
Enum.map(suggestions, fn s -> IO.inspect({s, String.jaro_distance(s, target)}) end)
12+
Enum.map(suggestions, fn s -> {s, String.jaro_distance(s, target)} end)
1313
|> Enum.filter(fn {_, x} -> x >= threshold end)
1414
|> Enum.sort_by(fn {_, x} -> x end)
1515
|> Enum.map(fn {s, _} -> s end)

0 commit comments

Comments
 (0)