readings generator script added

This commit is contained in:
Alexander Bocken 2020-12-02 13:21:57 +01:00
commit 6cc5d7a501
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
4 changed files with 4417 additions and 0 deletions

BIN
euctabletxt.txt Normal file

Binary file not shown.

View File

@ -0,0 +1,15 @@
#!/bin/bash
#Doanloads readings from nihongo.monash using the EUC-JP standard of the Kanji in question.
while read -r line; do
index="$( echo "$line" | cut -f1)"
EUCJP="$( echo "$line" | cut -f2)"
url="http://nihongo.monash.edu/cgi-bin/wwwjdic?1MKJ${EUCJP}#"
curl -s "$url" > raw_html
ON="$(hxnormalize -i 0 -x raw_html | hxselect 'table' | awk 'BEGIN {printout=100000000000}; NR==printout+2 {print $0}; /ON reading/ {printout=NR}'| sed 's/<td><b>//; s/<\/b><\/td>//' )"
KUN="$(hxnormalize -i 0 -x raw_html | hxselect 'table' | awk 'BEGIN {printout=100000000000}; NR==printout+2 {print $0}; /KUN reading/ {printout=NR}'| sed 's/<td><b>//; s/<\/b><\/td>//')"
NAN="$(hxnormalize -i 0 -x raw_html | hxselect 'table' | awk 'BEGIN {printout=100000000000}; NR==printout+2 {print $0}; /Nanori reading/ {printout=NR}'| sed 's/<td><b>//; s/<\/b><\/td>//')"
printf '%s\t%s\t%s\t%s\n' "$index" "$ON" "$KUN" "$NAN"
rm raw_html
done<index_kanji
#curl -s http://nihongo.monash.edu/cgi-bin/wwwjdic?1MKJ%B4%D6# | hxnormalize -i 0 -x | hxselect 'table' | awk 'BEGIN {printout=100000000000}; NR==printout+2 {print $0}; /ON reading/ {printout=NR}' | sed 's/<td><b>//; s/<\/b><\/td>//'

File diff suppressed because it is too large Load Diff

2201
readings_generator/readings Normal file

File diff suppressed because it is too large Load Diff