Skip to content

Commit

Permalink
EticaAI/numerordinatio#5: 999999 instead of 99999999 for temporary files
Browse files Browse the repository at this point in the history
  • Loading branch information
eticaaibot committed Jan 4, 2022
1 parent 96873df commit b837078
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 19 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions 999999/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# {999999} /temporary files/@eng-Latn
1 change: 0 additions & 1 deletion 99999999/README.md

This file was deleted.

14 changes: 8 additions & 6 deletions 999999999/1603.45.49.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DATA_UN_M49_CSV="https://proxy.hxlstandard.org/data.csv?dest=data_edit&filter01=

# @TODO: implement some option to use cached file instead of re-download;
# for now we're just commenting the next line
wget -qO- "$DATA_UN_M49_CSV" > "${ROOTDIR}/99999999/1603/45/49/1603.45.49.hxl.csv"
wget -qO- "$DATA_UN_M49_CSV" > "${ROOTDIR}/999999/1603/45/49/1603.45.49.hxl.csv"


### 1603.45.49.hxl.csv --> 1603.45.49.tm.hxl.csv _______________________________
Expand All @@ -56,28 +56,30 @@ hxlrename \
--rename="#country+name+i_ru+alt+v_unterm:#item+rem+i_rus+is_cyrl+ix_unterm" \
--rename="#country+name+i_zh+alt+v_unterm:#item+rem+i_zho+is_hans+ix_unterm" \
--rename="#country+name+i_ar+alt+v_unterm:#item+rem+i_ara+is_arab+ix_unterm" \
"${ROOTDIR}/99999999/1603/45/49/1603.45.49.hxl.csv" \
"${ROOTDIR}/999999/1603/45/49/1603.45.49.hxl.csv" \
| hxlselect --query="#country+code+num+v_m49>0" \
| hxladd --before --spec="#item+rem+i_zxx+is_zmth+ix_unfts={{#country+code+v_fts}}" \
| hxladd --before --spec="#item+rem+i_zxx+is_zmth+ix_unreliefweb={{#country+code+v_reliefweb}}" \
| hxladd --before --spec="#item+rem+i_zxx+is_zmth+ix_unhrinfo={{#country+code+v_hrinfo_country}}" \
| hxladd --before --spec="#item+rem+i_zxx+is_zmth+ix_unm49={{#country+code+num+v_m49}}" \
| hxladd --before --spec="#item+conceptum+codicem={{#country+code+num+v_m49}}" \
| hxlsort --tags="#item+conceptum" \
> "${ROOTDIR}/99999999/1603/45/49/1603.45.49.tm.hxl.csv"
> "${ROOTDIR}/999999/1603/45/49/1603.45.49.tm.hxl.csv"

# @TODO: only do this if hxl did not removed empty header files ,,,,,,
sed -i '1d' "${ROOTDIR}/99999999/1603/45/49/1603.45.49.tm.hxl.csv"
sed -i '1d' "${ROOTDIR}/999999/1603/45/49/1603.45.49.tm.hxl.csv"

### 1603.45.49.tm.hxl.csv --> 1603.45.49.no1.tm.hxl.csv ________________________

hxlrename \
--rename="#country+code+v_iso2:#item+rem+i_zxx+is_latn+ix_iso3166p1a2" \
--rename="#country+code+v_iso3:#item+rem+i_zxx+is_latn+ix_iso3166p1a3" \
"${ROOTDIR}/99999999/1603/45/49/1603.45.49.tm.hxl.csv" \
"${ROOTDIR}/999999/1603/45/49/1603.45.49.tm.hxl.csv" \
| hxladd --before --spec="#item+conceptum+numerordinatio=${PRAEFIXUM}{{(#item+conceptum+codicem)+1-1}}" \
| hxlcut --include="#item+conceptum,#item+rem" \
> "${ROOTDIR}/1603/45/49/1603.45.49.no1.tm.hxl.csv"

# @TODO: only do this if hxl did not removed empty header files ,,,,,,
sed -i '1d' "${ROOTDIR}/1603/45/49/1603.45.49.no1.tm.hxl.csv"
sed -i '1d' "${ROOTDIR}/1603/45/49/1603.45.49.no1.tm.hxl.csv"

set +x
21 changes: 12 additions & 9 deletions 999999999/1603.47.15924.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#===============================================================================
# Comment next line if not want to stop on first error
set -e
set -x

ROOTDIR="$(pwd)"

Expand All @@ -39,36 +40,38 @@ DATA_ISO_15924_TXT="https://www.unicode.org/iso15924/iso15924.txt"

# @TODO: implement some option to use cached file instead of re-download;
# for now we're just commenting the next line
wget -qO- "$DATA_ISO_15924_TXT" > "${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.txt"
wget -qO- "$DATA_ISO_15924_TXT" > "${ROOTDIR}/999999/1603/47/15924/1603.47.15924.txt"


## 1603.47.15924.txt --> 1603.47.15924.hxl.csv
echo "#code+v_iso1524a;#code+v_iso1524n;#item+name+i_eng+is_latn;#item+name+i_fra+is_latn;#meta+pva;#meta+unicode+version;#date" \
> "${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.hxl.csv"
tail -n +8 "${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.txt" \
>> "${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.hxl.csv"
> "${ROOTDIR}/999999/1603/47/15924/1603.47.15924.hxl.csv"
tail -n +8 "${ROOTDIR}/999999/1603/47/15924/1603.47.15924.txt" \
>> "${ROOTDIR}/999999/1603/47/15924/1603.47.15924.hxl.csv"

### 1603.47.15924.hxl.csv --> 1603.47.15924.tm.hxl.csv _________________________
hxlrename \
--rename="#code+v_iso1524n:#item+rem+i_zxx+is_zmth+ix_iso1524n" \
--rename="#code+v_iso1524a:#item+rem+i_zxx+is_latn+ix_iso1524a" \
--rename="#item+name+i_eng+is_latn:#item+rem+i_eng+is_latn" \
--rename="#item+name+i_fra+is_latn:#item+rem+i_fra+is_latn" \
"${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.hxl.csv" \
"${ROOTDIR}/999999/1603/47/15924/1603.47.15924.hxl.csv" \
| hxladd --before --spec="#item+conceptum+codicem={{#item+rem+i_zxx+is_zmth+ix_iso1524n}}" \
| hxlcut --include="#item+conceptum,#item+rem" \
| hxlsort --tags="#item+conceptum" \
> "${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.tm.hxl.csv"
> "${ROOTDIR}/999999/1603/47/15924/1603.47.15924.tm.hxl.csv"


# @TODO: only do this if hxl did not removed empty header files ,,,,,,
sed -i '1d' "${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.tm.hxl.csv"
sed -i '1d' "${ROOTDIR}/999999/1603/47/15924/1603.47.15924.tm.hxl.csv"

hxladd --before --spec="#item+conceptum+numerordinatio=${PRAEFIXUM}{{(#item+conceptum+codicem)+1-1}}" \
"${ROOTDIR}/99999999/1603/47/15924/1603.47.15924.tm.hxl.csv" \
"${ROOTDIR}/999999/1603/47/15924/1603.47.15924.tm.hxl.csv" \
"${ROOTDIR}/1603/47/15924/1603.47.15924.no1.tm.hxl.csv"

# @TODO: only do this if hxl did not removed empty header files ,,,,,,
sed -i '1d' "${ROOTDIR}/1603/47/15924/1603.47.15924.no1.tm.hxl.csv"

# TODO: make the conversion to JSON format. Or enable the JavaScript to support tm.hxl.csv files
# TODO: make the conversion to JSON format. Or enable the JavaScript to support tm.hxl.csv files

set +x
5 changes: 4 additions & 1 deletion 999999999/1603.47.639.3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#===============================================================================
# Comment next line if not want to stop on first error
set -e
set -x

ROOTDIR="$(pwd)"

Expand All @@ -34,4 +35,6 @@ ROOTDIR="$(pwd)"

DATA_ISO_639_3_CSV="https://proxy.hxlstandard.org/data.csv?tagger-match-all=on&tagger-01-header=id&tagger-01-tag=%23vocab+%2Bid+%2Bv_iso6393_3letter&tagger-02-header=part2b&tagger-02-tag=%23vocab+%2Bcode+%2Bv_iso3692_3letter+%2Bz_bibliographic&tagger-03-header=part2t&tagger-03-tag=%23vocab+%2Bcode+%2Bv_3692_3letter+%2Bz_terminology&tagger-04-header=part1&tagger-04-tag=%23vocab+%2Bcode+%2Bv_6391&tagger-05-header=scope&tagger-05-tag=%23status&tagger-06-header=language_type&tagger-06-tag=%23vocab+%2Btype&tagger-07-header=ref_name&tagger-07-tag=%23description+%2Bname+%2Bi_en&tagger-08-header=comment&tagger-08-tag=%23description+%2Bcomment+%2Bi_en&url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1mlc3zLkdgGRMOts36PiK2eFrMazgidKs%2Fview%3Fusp%3Dsharing&header-row=1&dest=data_view"

wget -qO- "$DATA_ISO_639_3_CSV" > "${ROOTDIR}/99999999/1603/47/639/3/1603.47.639.3.hxl.csv"
wget -qO- "$DATA_ISO_639_3_CSV" > "${ROOTDIR}/999999/1603/47/639/3/1603.47.639.3.hxl.csv"

set +x
4 changes: 2 additions & 2 deletions 999999999/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {999999999} /hic sunt dracones/@lat-Latn

> - {99999999} /temporary files/@eng-Latn:
> - [../99999999](../99999999)
> - {999999} /temporary files/@eng-Latn:
> - [../999999](../999999)
```txt
'X)
Expand Down

0 comments on commit b837078

Please sign in to comment.