From 5ab0bdf0a9bf63771a60b59062d2f0b3363cfdc2 Mon Sep 17 00:00:00 2001 From: Emerson Rocha Date: Fri, 18 Mar 2022 05:51:47 -0300 Subject: [PATCH] 1603_1.py (#12, #26): --codex-in-tabulam-json, better output (still fake data) --- .gitignore | 1 + officinam/999999999/0/1603_1.py | 67 ++++++++++++++++++++++++++++++-- officinam/999999999/999999_17.sh | 42 +++++++++++--------- 3 files changed, 87 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index cfe445b..c2b401d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ /officinam/**/**.tbx /officinam/**/**.png /officinam/**/**.jpg +/officinam/**/**.json # /officinam/README.md /officinam/LICENSE.md /officinam/package.json diff --git a/officinam/999999999/0/1603_1.py b/officinam/999999999/0/1603_1.py index e26309e..e063054 100755 --- a/officinam/999999999/0/1603_1.py +++ b/officinam/999999999/0/1603_1.py @@ -2681,11 +2681,40 @@ def _columnae(self) -> list: list: _description_ """ res = [] - res.append({'name': '#item+conceptum+codicem', 'type': 'string'}) + res.append({'name': 'item__conceptum__codicem', 'type': 'string', + 'title': { + 'la': 'Codicem' + }}) res.append( - {'name': '#item+rem+i_qcc+is_zxxx+ix_wikiq', 'type': 'string'}) + {'name': 'item__rem__i_qcc__is_zxxx__ix_wikiq', 'type': 'string', + 'title': { + 'la': 'Q ID' + }}) res.append( - {'name': '#item+rem+i_mul+is_zyyy', 'type': 'string'}) + {'name': 'item__rem__i_mul__is_zyyy', 'type': 'string', + 'title': { + 'la': 'Linguae multiplīs (Scrīptum incognitō)' + }}) + + clavem = self.codex.codex[0].keys() + # for item in clavem: + # pass + # res.append( + # {'name': 'item__rem__terminum', 'type': 'localized', + # 'title': { + # 'la': 'Lingua Latina (Abecedarium Latinum)', + # 'en': 'Lingua Anglica (Abecedarium Latinum)', + # 'pt': 'Lingua Lusitana (Abecedarium Latinum)', + # }}) + res.append( + {'name': 'item__rem__terminum', 'type': 'localized', + 'title': { + 'la': 'Rēs linguālibus', + 'en': 'Lingual thing', + # 'en': 'Lingua Anglica (Abecedarium Latinum)', + # 'pt': 'Lingua Lusitana (Abecedarium Latinum)', + }}) + return res def dicitionaria_rebus(self) -> list: @@ -2704,7 +2733,34 @@ def dicitionaria_rebus(self) -> list: res.append([ '1', 'Q1', - '/salvi mundi!/@lat-Latn' + '/salvi mundi!/@lat-Latn', + { + 'la': 'testum est', + 'en': 'testing testing', + 'pt': 'teste teste', + } + ]) + res.append([ + '2', + 'Q2', + '/test/@lat-Latn', + None + ]) + res.append([ + '2_3', + 'Q345', + '/test test test/@lat-Latn', + { + 'pt': 'teste teste', + } + ]) + res.append([ + '33', + 'Q33', + '/teste em espanhol/@por-Latn', + { + 'es': 'teste en espanol', + } ]) return res @@ -2722,6 +2778,9 @@ def imprimere_textum(self) -> list: 'license': "CC0-1.0", 'sources': "https://github.com/EticaAI/multilingual-lexicography " "+ https://www.wikidata.org/wiki/Help:Multilingual", + 'description': { + 'la': str(self.codex.de_codex) + }, 'schema': { 'fields': self._columnae() }, diff --git a/officinam/999999999/999999_17.sh b/officinam/999999999/999999_17.sh index 97cd25c..a044f9a 100755 --- a/officinam/999999999/999999_17.sh +++ b/officinam/999999999/999999_17.sh @@ -26,6 +26,10 @@ set -e # time HTTPS_PROXY="socks5://127.0.0.1:9050" ./999999999/999999_17.sh +# ./999999999/0/1603_1.py --codex-de 1603_45_31 --codex-in-tabulam-json | jq +# ./999999999/0/1603_1.py --codex-de 1603_45_31 --codex-in-tabulam-json > 1603/45/31/1603_45_31.mul-Latn.tab.json +# https://commons.wikimedia.org/wiki/Data:Sandbox/EmericusPetro/Example.tab + # humanitarium_responsum_rem="https://proxy.hxlstandard.org/data/download/humanitarium-responsum-rem_hxl.csv?dest=data_edit&filter01=select&filter-label01=%23status%3E-1&select-query01-01=%23status%3E-1&filter02=cut&filter-label02=HXLated&cut-skip-untagged02=on&strip-headers=on&force=on&url=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1ih3ouvx_n8W5ntNcYBqoyZ2NRMdaA0LRg5F9mGriZm4%2Fedit%23gid%3D1331879749" DATA_1603_1_1="https://docs.google.com/spreadsheets/d/1ih3ouvx_n8W5ntNcYBqoyZ2NRMdaA0LRg5F9mGriZm4/edit#gid=2095477004" DATA_1603_1_6="https://docs.google.com/spreadsheets/d/1ih3ouvx_n8W5ntNcYBqoyZ2NRMdaA0LRg5F9mGriZm4/edit#gid=1417450794" @@ -106,15 +110,15 @@ file_convert_numerordinatio_de_hxltm "1603_1_51" "1" "0" # neo_codex_de_numerordinatio "1603_1_7" "0" "0" # neo_codex_de_numerordinatio_pdf "1603_1_7" "0" "0" -# file_download_if_necessary "$DATA_1603_45_31" "1603_45_31" "csv" "tm.hxl.csv" "hxltmcli" "1" -# file_convert_numerordinatio_de_hxltm "1603_45_31" "1" "0" -# file_translate_csv_de_numerordinatio_q "1603_45_31" "0" "0" -# file_merge_numerordinatio_de_wiki_q "1603_45_31" "0" "0" -# file_convert_tmx_de_numerordinatio11 "1603_45_31" -# file_convert_tbx_de_numerordinatio11 "1603_45_31" -# neo_codex_de_numerordinatio "1603_45_31" "0" "0" -# neo_codex_de_numerordinatio_epub "1603_45_31" "0" "0" -# neo_codex_de_numerordinatio_pdf "1603_45_31" "0" "0" +file_download_if_necessary "$DATA_1603_45_31" "1603_45_31" "csv" "tm.hxl.csv" "hxltmcli" "1" +file_convert_numerordinatio_de_hxltm "1603_45_31" "1" "0" +file_translate_csv_de_numerordinatio_q "1603_45_31" "0" "0" +file_merge_numerordinatio_de_wiki_q "1603_45_31" "0" "0" +file_convert_tmx_de_numerordinatio11 "1603_45_31" +file_convert_tbx_de_numerordinatio11 "1603_45_31" +neo_codex_de_numerordinatio "1603_45_31" "0" "0" +neo_codex_de_numerordinatio_epub "1603_45_31" "0" "0" +neo_codex_de_numerordinatio_pdf "1603_45_31" "0" "0" # file_download_if_necessary "$DATA_1603_23_21" "1603_23_21" "csv" "tm.hxl.csv" "hxltmcli" "1" # file_convert_numerordinatio_de_hxltm "1603_23_21" "1" "0" @@ -147,16 +151,16 @@ file_convert_numerordinatio_de_hxltm "1603_1_51" "1" "0" # neo_codex_de_numerordinatio "1603_45_19" "0" "0" # neo_codex_de_numerordinatio_pdf "1603_45_19" "0" "0" -file_download_if_necessary "$DATA_1603_63_101" "1603_63_101" "csv" "tm.hxl.csv" "hxltmcli" "1" -file_convert_numerordinatio_de_hxltm "1603_63_101" "1" "0" -file_translate_csv_de_numerordinatio_q "1603_63_101" "0" "0" -file_merge_numerordinatio_de_wiki_q "1603_63_101" "0" "0" -file_convert_tmx_de_numerordinatio11 "1603_63_101" -file_convert_tbx_de_numerordinatio11 "1603_63_101" -neo_codex_copertae_de_numerordinatio "1603_63_101" "0" "0" -neo_codex_de_numerordinatio "1603_63_101" "0" "0" -neo_codex_de_numerordinatio_epub "1603_63_101" "0" "0" -neo_codex_de_numerordinatio_pdf "1603_63_101" "0" "0" +# file_download_if_necessary "$DATA_1603_63_101" "1603_63_101" "csv" "tm.hxl.csv" "hxltmcli" "1" +# file_convert_numerordinatio_de_hxltm "1603_63_101" "1" "0" +# file_translate_csv_de_numerordinatio_q "1603_63_101" "0" "0" +# file_merge_numerordinatio_de_wiki_q "1603_63_101" "0" "0" +# file_convert_tmx_de_numerordinatio11 "1603_63_101" +# file_convert_tbx_de_numerordinatio11 "1603_63_101" +# neo_codex_copertae_de_numerordinatio "1603_63_101" "0" "0" +# neo_codex_de_numerordinatio "1603_63_101" "0" "0" +# neo_codex_de_numerordinatio_epub "1603_63_101" "0" "0" +# neo_codex_de_numerordinatio_pdf "1603_63_101" "0" "0" # file_download_if_necessary "$DATA_1603_64_41" "1603_64_41" "csv" "tm.hxl.csv" "hxltmcli" "1" # file_convert_numerordinatio_de_hxltm "1603_64_41" "1" "0"