-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate downloads table on release (#96)
* downloads file * name release with calver * wip * fix typo * iterate faster * try 2 * try 3 * try chmod * try temp.md * add preamble * add downloads section link * typo * remove testing langauges * remove temp test prefix
- Loading branch information
1 parent
e522777
commit 43b882c
Showing
6 changed files
with
109 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Downloads | ||
|
||
This page contains 4 types of dictionary files: | ||
|
||
1. Bilingual dictionaries - `kty-en-de.zip` for example has English headwords and their definitions/translations in German. | ||
2. Monolingual dictionaries - `kty-en-en.zip` and such. | ||
3. International Phonetic Alphabet (IPA) dictionaries from a single wiktionary edition - e.g. `kty-en-en-ipa.zip` | ||
4. Merged IPA dictionaries from all 6 wiktionary editions - e.g. `kty-en-ipa.zip`. These have more terms covered but not all the entries might be formatted the same way. | ||
|
||
Note that [Kaikki](https://kaikki.org/dictionary/rawdata.html) currently only supports 6 wiktionary editions (English, Chinese, French, German, Russian and Spanish), so only dictionaries with definitions in these languages are available. | ||
|
||
If the language you want isn't here, or you would like to see an improvement to a dictionary, please [open an issue](https://github.com/themoeway/kaikki-to-yomitan/issues/new). | ||
|
||
Some of the dictionaries listed here are small; rather than decide on a lower bound for usefulness they are all included here. | ||
|
||
<sub><sup> Languages are referred to by their shortest [ISO code](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) (ISO 639-1 where available, [ISO 639-3](https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes) where not)</sup></sub> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
find data/language -type f -name '*.zip' > zip_files.txt | ||
|
||
check_file_exists() { | ||
local filename=$1 | ||
while IFS= read -r file; do | ||
# Extract the part of the path after 'kty-' and before the '.zip' | ||
extracted_name=$(basename "$file" .zip | sed 's/^kty-//') | ||
if [ "$extracted_name" = "$filename" ]; then | ||
return 0 | ||
fi | ||
done < zip_files.txt | ||
return 1 | ||
} | ||
|
||
declare -a languages="($( | ||
jq -r '.[] | @json | @sh' languages.json | ||
))" | ||
|
||
echo "| | English (en) | Chinese (zh) | French (fr) | German (de) | Russian (ru) | Spanish (es) | Merged IPA |" > temp.md | ||
echo "|---|---|---|---|---|---|---|---|" >> temp.md | ||
columns=("en" "zh" "fr" "de" "ru" "es" "ipa") | ||
for source_lang in "${languages[@]}"; do | ||
source_iso=$(echo "${source_lang}" | jq -r '.iso') | ||
source_language_name=$(echo "${source_lang}" | jq -r '.language') | ||
|
||
row="| $source_language_name ($source_iso)" | ||
|
||
for column in "${columns[@]}"; do | ||
|
||
if [ "$column" = "ipa" ]; then | ||
expected_filenames=("${source_iso}-ipa") | ||
else | ||
expected_filenames=("${source_iso}-${column}" "${source_iso}-${column}-ipa") | ||
fi | ||
|
||
cell="" | ||
for expected_filename in "${expected_filenames[@]}"; do | ||
if check_file_exists "$expected_filename"; then | ||
cell="$cell [kty-$expected_filename.zip](https://github.com/themoeway/kaikki-to-yomitan/releases/latest/download/kty-$expected_filename.zip) </br>" | ||
fi | ||
done | ||
row="$row | $cell" | ||
done | ||
echo "$row" >> temp.md | ||
done | ||
|
||
cat temp.md | ||
rm temp.md |