diff --git a/.envrc b/.envrc index 8dfc6aa..8a7d29b 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,3 @@ use flake || use nix + +PATH_add node_modules/.bin diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..5476ddc --- /dev/null +++ b/Justfile @@ -0,0 +1,43 @@ +_default: + just --list + +validate-words: + #!/usr/bin/env bash + set -euo pipefail + + for i in src/dictionary/*/*.yaml + do + word=$(grep 'entry:' $i | cut -f 2 -d : | cut -c 2-) + + if ! fedran-miwafu validate $word + then + echo "$i: bad" + fi + done + +sort-dictionary-files: + #!/usr/bin/env bash + set -euo pipefail + + for i in src/dictionary/*/*.yaml + do + word=$(grep 'entry:' $i | cut -f 2 -d : | cut -c 2-) + prefix=$(fedran-miwafu split $word | cut -f 1 -d ' ') + path="src/dictionary/$prefix/$word.yaml" + + if [ "$i" != "$path" ] + then + echo "renaming $i -> $path" + + if [ -f "$path" ] + then + echo " already exists" + else + echo " moved" + mkdir -p "src/dictionary/$prefix" + mv -i "$i" "$path" + fi + fi + + rmdir src/dictionary/* 2> /dev/null || true + done \ No newline at end of file diff --git a/src/new-dictionary/_meta.yaml b/src/dictionary/_meta.yaml similarity index 100% rename from src/new-dictionary/_meta.yaml rename to src/dictionary/_meta.yaml diff --git a/src/new-dictionary/asanogi.yaml b/src/dictionary/a/asanogi.yaml similarity index 100% rename from src/new-dictionary/asanogi.yaml rename to src/dictionary/a/asanogi.yaml