From fb9224e2f53185befac8ac4c6fc8c047bcc29e2a Mon Sep 17 00:00:00 2001 From: Lexy Plt Date: Sun, 22 Mar 2026 16:19:46 +0100 Subject: [PATCH 1/2] fix(string): use <= when searching for a min dist inside levenshteinDistance, instead of < --- String.ark | 4 ++-- tests/string-tests.ark | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/String.ark b/String.ark index b44fbbf..8b28f0f 100644 --- a/String.ark +++ b/String.ark @@ -556,9 +556,9 @@ _edit_distances _i _j - (if (and (< (@ _dist 0) (@ _dist 1)) (< (@ _dist 0) (@ _dist 2))) + (if (and (<= (@ _dist 0) (@ _dist 1)) (<= (@ _dist 0) (@ _dist 2))) (@ _dist 0) - (if (and (< (@ _dist 1) (@ _dist 0)) (< (@ _dist 1) (@ _dist 2))) + (if (and (<= (@ _dist 1) (@ _dist 0)) (<= (@ _dist 1) (@ _dist 2))) (@ _dist 1) (@ _dist 2)))) (set _j (+ 1 _j)) }) diff --git a/tests/string-tests.ark b/tests/string-tests.ark index 2737082..c758ab0 100644 --- a/tests/string-tests.ark +++ b/tests/string-tests.ark @@ -167,5 +167,16 @@ (test:eq (string:levenshteinDistance "arkscript" "arkscript") 0) (test:eq (string:levenshteinDistance "arkscript" "Orkscript") 1) (test:eq (string:levenshteinDistance "arkscript" "0rCscript") 2) - (test:eq (string:levenshteinDistance "arkscript" "OrC") 8) }) -}) + (test:eq (string:levenshteinDistance "arkscript" "OrC") 8) + (test:eq (string:levenshteinDistance "before" "order") 5) + (test:eq (string:levenshteinDistance "time" "system") 5) + (test:eq (string:levenshteinDistance "state" "present") 6) + (test:eq (string:levenshteinDistance "square" "consider") 7) + (test:eq (string:levenshteinDistance "after" "carbohydrate") 10) + (test:eq (string:levenshteinDistance "dictionary" "general") 9) + (test:eq (string:levenshteinDistance "incomprehensible" "public") 14) + (test:eq (string:levenshteinDistance "under" "square") 5) + (test:eq (string:levenshteinDistance "there" "number") 5) + (test:eq (string:levenshteinDistance "there" "never") 4) + (test:eq (string:levenshteinDistance "structure" "interest") 8) + (test:eq (string:levenshteinDistance "possible" "public") 6) }) }) From 87ee92945a03445332f62e57aeb2af86a7eb277e Mon Sep 17 00:00:00 2001 From: Lexy Plt Date: Sun, 22 Mar 2026 16:22:31 +0100 Subject: [PATCH 2/2] fix(ci): split master/PR CI and documentation update CI --- .github/workflows/ci.yml | 13 ------------- .github/workflows/docs.yml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 198083f..0603907 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,16 +61,3 @@ jobs: ./arkscript --version mkdir -p std && mv *.ark std/ ./arkscript --lib ./ tests/all.ark - - update-docs: - runs-on: ubuntu-24.04 - name: "Update website documentation" - needs: [ build ] - - steps: - - name: Create repository dispatch event - if: github.ref == 'refs/heads/master' - env: - GITHUB_TOKEN: ${{ secrets.WEBSITE_PUSH_COMMIT_GITHUB_TOKEN }} - run: | - gh api repos/ArkScript-lang/website/dispatches --raw-field event_type=my_update_docs diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..32f69e3 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,18 @@ +name: Update docs + +on: + push: + branches: [ master ] + +jobs: + update-docs: + runs-on: ubuntu-24.04 + name: "Update website documentation" + + steps: + - name: Create repository dispatch event + if: github.ref == 'refs/heads/master' + env: + GITHUB_TOKEN: ${{ secrets.WEBSITE_PUSH_COMMIT_GITHUB_TOKEN }} + run: | + gh api repos/ArkScript-lang/website/dispatches --raw-field event_type=my_update_docs