From 94bd04a2c299050938a2ae628299be04c568f596 Mon Sep 17 00:00:00 2001 From: Emerson Rocha Date: Sun, 17 Apr 2022 19:31:33 -0300 Subject: [PATCH] 1603_1.py (#29): improved checks --- officinam/999999999/0/1603_1.py | 57 +++++++-- officinam/999999999/999999999.lib.sh | 63 +++++++-- officinam/999999999/999999_17.sh | 5 +- officinam/README.md | 184 ++++++++++++++++----------- 4 files changed, 215 insertions(+), 94 deletions(-) diff --git a/officinam/999999999/0/1603_1.py b/officinam/999999999/0/1603_1.py index dfc37a0..9579ede 100755 --- a/officinam/999999999/0/1603_1.py +++ b/officinam/999999999/0/1603_1.py @@ -3150,19 +3150,18 @@ def imprimere_in_markdown(self): paginae.append(' - concepta_non_unicum: {0}'.format( status['status_quo']['summa']['concepta_non_unicum'])) paginae.append('') + for codex, item in status['librarium'].items(): - paginae.append('## {0} {1}'.format(codex, item['meta']['nomen'])) - paginae.append('- status_quo') - paginae.append( - ' - concepta: {0}'.format(item['status_quo']['summa']['concepta'])) - paginae.append( - ' - res_interlingualibus: {0}'.format( - item['status_quo']['summa']['res_interlingualibus'])) + + caveat_lector = self.imprimere_res_caveat_lector(item) + corde = self.imprimere_res_methodi_ex_dictionariorum_corde(item) + paginae.append( - ' - res_lingualibus: {0}'.format( - item['status_quo']['summa']['res_lingualibus'])) + '## {0} {1}'.format(codex, item['meta']['nomen'])) + paginae.append('') - paginae.append('
details') + paginae.append( + '
🔎🗄️{0}🗄️🔍'.format(codex)) paginae.append('') paginae.append('```json') # paginae.append('') @@ -3173,12 +3172,50 @@ def imprimere_in_markdown(self): paginae.append('') paginae.append('
') paginae.append('') + + paginae.append('- status_quo') + paginae.append( + ' - concepta: {0}'.format(item['status_quo']['summa']['concepta'])) + paginae.append( + ' - res_interlingualibus: {0}'.format( + item['status_quo']['summa']['res_interlingualibus'])) + paginae.append( + ' - res_lingualibus: {0}'.format( + item['status_quo']['summa']['res_lingualibus'])) + + if corde: + paginae.append( + '### {0} Methodī ex dictiōnāriōrum corde'.format(codex)) + paginae.append('') + paginae.append(corde) + paginae.append('') + + if caveat_lector: + paginae.append('### {0} Caveat_lector'.format(codex)) + paginae.append('') + paginae.append(caveat_lector) + paginae.append('') + paginae.append('') # return [yaml.dump( # status, allow_unicode=True)] return paginae + def imprimere_res_caveat_lector(self, item): + if item and 'meta' in item and \ + 'caveat_lector' in item['meta'] and \ + 'mul-Zyyy' in item['meta']['caveat_lector']: + return item['meta']['caveat_lector']['mul-Zyyy'] + return None + + def imprimere_res_methodi_ex_dictionariorum_corde(self, item): + if item and 'meta' in item and \ + 'methodi_ex_dictionariorum_corde' in item['meta'] and \ + 'mul-Zyyy' in item['meta']['methodi_ex_dictionariorum_corde']: + return item['meta']['methodi_ex_dictionariorum_corde']['mul-Zyyy'] + return None + class CodexInTabulamJson: """Codex Sarcinarum Adnexīs diff --git a/officinam/999999999/999999999.lib.sh b/officinam/999999999/999999999.lib.sh index fa6c02d..7236e92 100644 --- a/officinam/999999999/999999999.lib.sh +++ b/officinam/999999999/999999999.lib.sh @@ -353,8 +353,8 @@ file_convert_csv_de_downloaded_xlsx() { est_temporarium_fontem="${2:-"1"}" est_temporarium_objectivum="${3:-"1"}" # opus_papyro="${4:-"10"}" # Not really necessary if using in2csv - # (name of sheet). However it still trying to infer - # the numbers + # (name of sheet). However it still trying to infer + # the numbers _path=$(numerordinatio_neo_separatum "$numerordinatio" "/") _nomen=$(numerordinatio_neo_separatum "$numerordinatio" "_") @@ -382,7 +382,7 @@ file_convert_csv_de_downloaded_xlsx() { # hxltmcli --sheet "$opus_papyro" "$fontem_archivum" "$objectivum_archivum_temporarium" # hxlclean --sheet "$opus_papyro" "$fontem_archivum" "$objectivum_archivum_temporarium" # in2csv --format xlsx --no-inference --skip-lines 17 --sheet "$_nomen" "$fontem_archivum" > "${objectivum_archivum_temporarium_csv}" - in2csv --format xlsx --no-inference --skip-lines 17 --sheet "$_nomen" "$fontem_archivum" > "${objectivum_archivum_temporarium_csv}" + in2csv --format xlsx --no-inference --skip-lines 17 --sheet "$_nomen" "$fontem_archivum" >"${objectivum_archivum_temporarium_csv}" # issue: in2csv is adding ".0" to #item+conceptum+codicem for integers. even with --no-inference # set +x @@ -967,7 +967,7 @@ file_translate_csv_de_numerordinatio_q() { if [ -z "$(stale_archive "$objectivum_archivum")" ]; then if [ "$always_stale" != '1' ]; then - return 0; + return 0 fi echo "Cache may exist, but always_stale enabled [$numerordinatio]" fi @@ -2054,6 +2054,39 @@ fi # boring calls. # ################################################################################ +####################################### +# Check if Numerodinatio needs Wikidata Q +# +# Globals: +# ROOTDIR +# Arguments: +# numerordinatio +# Outputs: +# (empty) +# Returns: +# 0: success; have the tag +# 1: fail; do not have the tag +####################################### +quaero__ix_n1603ia__victionarium_q() { + numerordinatio="$1" + + _nomen=$(numerordinatio_neo_separatum "$numerordinatio" "_") + + resultatum=$("${ROOTDIR}/999999999/0/1603_1.py" \ + --ex-opere-temporibus='cdn' \ + --quaero-ix_n1603ia='{victionarium_q}>1' \ + --quaero-numerordinatio="$_nomen") + + # echo "resultatum" + # echo "[$resultatum]" + + if [ -z "$resultatum" ]; then + return 1 + else + return 0 + fi +} + ####################################### # Opus temporibus # @@ -2078,7 +2111,7 @@ opus_temporibus_cdn() { --quaero-ix_n1603ia='({publicum}>=11)' \ --in-ordinem=chaos \ --in-limitem=2 \ - > "$opus_temporibus_temporarium" + >"$opus_temporibus_temporarium" while IFS=$'\t' read -r -a line; do # echo "${line[0]}" @@ -2148,10 +2181,11 @@ temp_save_status() { ####################################### actiones_completis_publicis() { numerordinatio="$1" + echo "" blue=$(tput setaf 4) normal=$(tput sgr0) - printf "%40s\n" "${blue}${FUNCNAME[0]} [$numerordinatio]${normal}" + printf "\t%40s\n" "${blue}${FUNCNAME[0]} [$numerordinatio]${normal}" # @TODO: implement the download # file_download_if_necessary "$DATA_1603_45_31" "1603_45_31" "csv" "tm.hxl.csv" "hxltmcli" "1" @@ -2160,10 +2194,17 @@ actiones_completis_publicis() { # @TODO: implement decent check if need download Wikidata Q again # now is hardcoded as "1" on last parameter # file_translate_csv_de_numerordinatio_q "$numerordinatio" "0" "0" - file_translate_csv_de_numerordinatio_q "$numerordinatio" "0" "0" "1" - file_merge_numerordinatio_de_wiki_q "$numerordinatio" "0" "0" - file_convert_tmx_de_numerordinatio11 "$numerordinatio" - file_convert_tbx_de_numerordinatio11 "$numerordinatio" + + if [ -z "$(quaero__ix_n1603ia__victionarium_q "$numerordinatio")" ]; then + echo "yay" + file_translate_csv_de_numerordinatio_q "$numerordinatio" "0" "0" "1" + file_merge_numerordinatio_de_wiki_q "$numerordinatio" "0" "0" + file_convert_tmx_de_numerordinatio11 "$numerordinatio" + file_convert_tbx_de_numerordinatio11 "$numerordinatio" + else + echo "noop" + fi + neo_codex_copertae_de_numerordinatio "$numerordinatio" "0" "0" neo_codex_de_numerordinatio "$numerordinatio" "0" "0" neo_codex_de_numerordinatio_epub "$numerordinatio" "0" "0" @@ -2183,5 +2224,5 @@ deploy_0_9_markdown() { --status-quo \ --ex-librario="cdn" \ --status-in-markdown \ - > "$objectivum_archivum" + >"$objectivum_archivum" } diff --git a/officinam/999999999/999999_17.sh b/officinam/999999999/999999_17.sh index 807856e..d170711 100755 --- a/officinam/999999999/999999_17.sh +++ b/officinam/999999999/999999_17.sh @@ -156,9 +156,12 @@ file_convert_numerordinatio_de_hxltm "1603_1_51" "1" "0" # temp_save_status "1603_45_31" # actiones_completis_publicis "1603_45_31" # actiones_completis_publicis "1603_63_101" -# opus_temporibus_cdn +opus_temporibus_cdn deploy_0_9_markdown +# quaero__ix_n1603ia__victionarium_q "1603_63_101" && echo "1603_63_101" +# quaero__ix_n1603ia__victionarium_q "1603_1_1" && echo "1603_1_1" + # file_download_if_necessary "$DATA_1603_23_36" "1603_23_36" "csv" "tm.hxl.csv" "hxltmcli" "1" # file_convert_numerordinatio_de_hxltm "1603_23_36" "1" "0" # file_translate_csv_de_numerordinatio_q "1603_23_36" "0" "0" diff --git a/officinam/README.md b/officinam/README.md index 5a4ed47..d5e0136 100644 --- a/officinam/README.md +++ b/officinam/README.md @@ -5,12 +5,8 @@ - concepta_non_unicum: 1064 ## 1603_25_1 //dictiōnāria de partes corporis humani// -- status_quo - - concepta: 10 - - res_interlingualibus: 14 - - res_lingualibus: 148 -
details +
🔎🗄️1603_25_1🗄️🔍 ```json { @@ -47,8 +43,8 @@ "status_quo": { "crc": { "concepta": null, - "res_interlingualibus": 3076867935, - "res_lingualibus": 1458830522, + "res_interlingualibus": 823561084, + "res_lingualibus": 3848275165, "res_picturae": null }, "summa": { @@ -58,7 +54,7 @@ "res_picturae": null }, "tempus": { - "opus": "2022-04-17T14:42:41" + "opus": "2022-04-17T18:47:57" } } } @@ -66,14 +62,22 @@
- -## 1603_44_101 /Dictiōnāria basibus dē sceleribus contrā persōnam/ - status_quo - - concepta: 22 + - concepta: 10 - res_interlingualibus: 14 - - res_lingualibus: 162 + - res_lingualibus: 148 +### 1603_25_1 Methodī ex dictiōnāriōrum corde + +This Numerodinatio namespace contains dictionaries related to general human body parts. Latin (while a natural language) actually is used as interlingual code. It's mostly based on Basle Nomina Anatomica 1895 ("BNA1895") and, if any difference, archaic terms are replaced with Terminologia Anatomica 95 ("TA95"). + +Compared to BNA1895 and TA95, 1603:25:1 is a very small subset, mostly a map to external body parts. + +All work on the main concept tables is manually compiled and reviewed by EticaAI. + + +## 1603_44_101 /Dictiōnāria basibus dē sceleribus contrā persōnam/ -
details +
🔎🗄️1603_44_101🗄️🔍 ```json { @@ -119,14 +123,14 @@
+- status_quo + - concepta: 22 + - res_interlingualibus: 14 + - res_lingualibus: 162 ## 1603_44_111 /Dictiōnāria basibus dē sceleribus contrā ūnam commūnitātem ab rēctōribus/ -- status_quo - - concepta: 36 - - res_interlingualibus: 16 - - res_lingualibus: 226 -
details +
🔎🗄️1603_44_111🗄️🔍 ```json { @@ -172,14 +176,14 @@
+- status_quo + - concepta: 36 + - res_interlingualibus: 16 + - res_lingualibus: 226 ## 1603_45_1 //dictiōnāria de hūmānitātēs interimperia// -- status_quo - - concepta: 347 - - res_interlingualibus: 15 - - res_lingualibus: 245 -
details +
🔎🗄️1603_45_1🗄️🔍 ```json { @@ -228,14 +232,14 @@
+- status_quo + - concepta: 347 + - res_interlingualibus: 15 + - res_lingualibus: 245 ## 1603_45_19 Dictiōnāria dē locī generibus -- status_quo - - concepta: 67 - - res_interlingualibus: 12 - - res_lingualibus: 241 -
details +
🔎🗄️1603_45_19🗄️🔍 ```json { @@ -281,14 +285,14 @@
+- status_quo + - concepta: 67 + - res_interlingualibus: 12 + - res_lingualibus: 241 ## 1603_45_31 Dictiōnāria de calamitātibus -- status_quo - - concepta: 25 - - res_interlingualibus: 14 - - res_lingualibus: 211 -
details +
🔎🗄️1603_45_31🗄️🔍 ```json { @@ -315,21 +319,29 @@ ] }, "meta": { + "caveat_lector": { + "mul-Zyyy": null + }, + "methodi_ex_dictionariorum_corde": { + "mul-Zyyy": "The decision making behind the concepts of the dictionaries is based mostly on calamities (disasters) commonly cited on emergency response in humanitarian areas. When this is the case, the interlingual external codes will also be added to the concept.\n\nThe terminology translations are extracted from Wikidata, which means this recommended derived works periodically check for updates." + }, "nomen": "Dictiōnāria de calamitātibus" }, "status_quo": { "crc": { "concepta": null, - "res_interlingualibus": 1822120724, - "res_lingualibus": 1822120724 + "res_interlingualibus": 3379006722, + "res_lingualibus": 1648089254, + "res_picturae": null }, "summa": { "concepta": 25, "res_interlingualibus": 14, - "res_lingualibus": 211 + "res_lingualibus": 211, + "res_picturae": null }, "tempus": { - "opus": "2022-04-17T00:08:00.634899" + "opus": "2022-04-17T18:46:14" } } } @@ -337,14 +349,20 @@
- -## 1603_63_101 //Dictiōnāria basibus dē rēbus vītālibus necessāriīs// - status_quo - - concepta: 332 + - concepta: 25 - res_interlingualibus: 14 - - res_lingualibus: 249 + - res_lingualibus: 211 +### 1603_45_31 Methodī ex dictiōnāriōrum corde -
details +The decision making behind the concepts of the dictionaries is based mostly on calamities (disasters) commonly cited on emergency response in humanitarian areas. When this is the case, the interlingual external codes will also be added to the concept. + +The terminology translations are extracted from Wikidata, which means this recommended derived works periodically check for updates. + + +## 1603_63_101 //Dictiōnāria basibus dē rēbus vītālibus necessāriīs// + +
🔎🗄️1603_63_101🗄️🔍 ```json { @@ -373,21 +391,29 @@ ] }, "meta": { + "caveat_lector": { + "mul-Zyyy": "Traditional paper dictionaries already are not complete enough to explain how their terms should or should not be used, so it should be no surprise that this one, despite having 100's of translations and machine readable alternatives, are also not intended as a use guide. However, compared to other compilations which can focus on narrow areas, this one in particular is below average of self-sufficiency." + }, + "methodi_ex_dictionariorum_corde": { + "mul-Zyyy": "`+//Dictiōnāria basibus dē rēbus vītālibus necessāriīs//+` (literal English translation: _basic dictionaries about necessary vital things_) is a **superficial** compilation of concepts for things (not procedures, nor full implementing guides) which could be _given_ to aid other humans or to whom or what give aid to other humans.\n\nSections 1 to 99, while not concrete things, contain concepts which may be used to decide needs assessment which we do not provide a more specialized dictionary compilation." + }, "nomen": "//Dictiōnāria basibus dē rēbus vītālibus necessāriīs//" }, "status_quo": { "crc": { "concepta": null, - "res_interlingualibus": 1822120724, - "res_lingualibus": 1822120724 + "res_interlingualibus": 1944666498, + "res_lingualibus": 849167894, + "res_picturae": null }, "summa": { "concepta": 332, "res_interlingualibus": 14, - "res_lingualibus": 249 + "res_lingualibus": 249, + "res_picturae": null }, "tempus": { - "opus": "2022-04-17T00:14:01.929693" + "opus": "2022-04-17T19:04:27" } } } @@ -395,14 +421,24 @@
+- status_quo + - concepta: 332 + - res_interlingualibus: 14 + - res_lingualibus: 249 +### 1603_63_101 Methodī ex dictiōnāriōrum corde + +`+//Dictiōnāria basibus dē rēbus vītālibus necessāriīs//+` (literal English translation: _basic dictionaries about necessary vital things_) is a **superficial** compilation of concepts for things (not procedures, nor full implementing guides) which could be _given_ to aid other humans or to whom or what give aid to other humans. + +Sections 1 to 99, while not concrete things, contain concepts which may be used to decide needs assessment which we do not provide a more specialized dictionary compilation. + +### 1603_63_101 Caveat_lector + +Traditional paper dictionaries already are not complete enough to explain how their terms should or should not be used, so it should be no surprise that this one, despite having 100's of translations and machine readable alternatives, are also not intended as a use guide. However, compared to other compilations which can focus on narrow areas, this one in particular is below average of self-sufficiency. + ## 1603_64_41 //Dictiōnāria basibus dē perītiae per susurrōs vītālēs// -- status_quo - - concepta: 56 - - res_interlingualibus: 12 - - res_lingualibus: 150 -
details +
🔎🗄️1603_64_41🗄️🔍 ```json { @@ -448,14 +484,14 @@
- -## 1603_64_604 //Dictiōnāria de aquīs et sānātiōnibus ex līmpidīs// - status_quo - - concepta: 28 + - concepta: 56 - res_interlingualibus: 12 - - res_lingualibus: 227 + - res_lingualibus: 150 -
details +## 1603_64_604 //Dictiōnāria de aquīs et sānātiōnibus ex līmpidīs// + +
🔎🗄️1603_64_604🗄️🔍 ```json { @@ -501,14 +537,14 @@
- -## 1603_84_1 /Dictiōnāria dentālium/ - status_quo - - concepta: 60 + - concepta: 28 - res_interlingualibus: 12 - - res_lingualibus: 4 + - res_lingualibus: 227 -
details +## 1603_84_1 /Dictiōnāria dentālium/ + +
🔎🗄️1603_84_1🗄️🔍 ```json { @@ -546,8 +582,8 @@ "status_quo": { "crc": { "concepta": null, - "res_interlingualibus": 745627346, - "res_lingualibus": 4199176814, + "res_interlingualibus": 2286177647, + "res_lingualibus": 1410003966, "res_picturae": null }, "summa": { @@ -557,7 +593,7 @@ "res_picturae": null }, "tempus": { - "opus": "2022-04-17T14:41:07" + "opus": "2022-04-17T19:05:25" } } } @@ -565,14 +601,14 @@
+- status_quo + - concepta: 60 + - res_interlingualibus: 12 + - res_lingualibus: 4 ## 1603_1_1 //Numeroclatura Generālium ad MM ex Numerordĭnātĭo//@lat-Latn -- status_quo - - concepta: 81 - - res_interlingualibus: 15 - - res_lingualibus: 9 -
details +
🔎🗄️1603_1_1🗄️🔍 ```json { @@ -599,8 +635,8 @@ "status_quo": { "crc": { "concepta": null, - "res_lingualibus": 3598764198, - "res_interlingualibus": 3384666531, + "res_lingualibus": 3475380778, + "res_interlingualibus": 619678332, "res_picturae": null }, "summa": { @@ -610,7 +646,7 @@ "res_picturae": null }, "tempus": { - "opus": "2022-04-17T18:20:52" + "opus": "2022-04-17T19:05:25" } } } @@ -618,4 +654,8 @@
+- status_quo + - concepta: 81 + - res_interlingualibus: 15 + - res_lingualibus: 9