diff --git a/bin/hxltmdexml.py b/bin/hxltmdexml.py index 681f893..e076e82 100755 --- a/bin/hxltmdexml.py +++ b/bin/hxltmdexml.py @@ -1365,10 +1365,10 @@ def de_xliff(self): # that XLIFF 2.x can have the souce and target language # defined already at element - # ontologia_de_xml = \ - # self._ontologia.crudum['normam']['XLIFF']['de_xml'] + ontologia_de_xml = \ + self._ontologia.crudum['normam']['XLIFF']['de_xml'] - # return self._de_commune_xml(ontologia_de_xml) + return self._de_commune_xml(ontologia_de_xml) resultatum_csv = csv.writer( self.objectvum_archivum, @@ -2023,10 +2023,12 @@ class HXLTMOntologia: >>> ontologia.quid_est_hashtag_circa_conceptum('#rem+rem+i_la+i_lat+is_latn') False ->>> ontologia.quid_est_hashtag_circa_linguam('#item+conceptum+codicem') +>>> ontologia.quid_est_hashtag_circa_linguam_aut_terminum( +... '#item+conceptum+codicem') False ->>> ontologia.quid_est_hashtag_circa_linguam('#rem+rem+i_la+i_lat+is_latn') +>>> ontologia.quid_est_hashtag_circa_linguam_aut_terminum( +... '#rem+rem+i_la+i_lat+is_latn') True @@ -2618,7 +2620,7 @@ def quid_est_hashtag_circa_conceptum( # TODO: make this actually read the cor.hxltm.215.yml. This hardcoded # part is just a quick fix - if HXLTMOntologia.quid_est_hashtag_circa_linguam(hxl_hashtag): + if HXLTMOntologia.quid_est_hashtag_circa_linguam_aut_terminum(hxl_hashtag): return False if hxl_hashtag.find('+conceptum') > -1: @@ -2627,7 +2629,7 @@ def quid_est_hashtag_circa_conceptum( return False @staticmethod - def quid_est_hashtag_circa_linguam(hxl_hashtag: str) -> bool: + def quid_est_hashtag_circa_linguam_aut_terminum(hxl_hashtag: str) -> bool: """Quid est hashtag circa linguam? _[eng-Latn] @@ -2643,6 +2645,11 @@ def quid_est_hashtag_circa_linguam(hxl_hashtag: str) -> bool: # TODO: make this actually read the cor.hxltm.215.yml. This hardcoded # part is just a quick fix + if hxl_hashtag.startswith('#item+linguam'): + return True + if hxl_hashtag.startswith('#meta+linguam'): + return True + if hxl_hashtag.startswith('#item+rem+i_'): return True if hxl_hashtag.startswith('#meta+rem+i_'): diff --git a/testum/disciplinam-manuale-anglicum.sh b/testum/disciplinam-manuale-anglicum.sh index b35ae1e..1a1ffb5 100755 --- a/testum/disciplinam-manuale-anglicum.sh +++ b/testum/disciplinam-manuale-anglicum.sh @@ -42,6 +42,18 @@ hxltmcli --help > "hxltmcli--help_eng-Latn.txt" # [eng-Latn]_ hxltmdexml --help > "hxltmdexml--help_eng-Latn.txt" +# +# To validate all XMLs +# find . -iname "*.xml" -o -iname "*.tbx" -o -iname "*.xlf" -type f | xargs xmlstarlet val + +### TODO: implement XML generic validation as part of the test +# if command -v xmlstarlet; then +# find . -iname "*.xml" -o -iname "*.tbx" -o -iname "*.xlf" -type f | xargs xmlstarlet val +# else +# echo "no XML test validation now" +# fi +### TODO: implement some way to also validate all CSVs on folder + # tag::HXLTM_CSV[] ### I ------------------------------------------------------------------------- # _[eng-Latn] diff --git a/testum/resultatum/csv-3-exemplum.csv b/testum/resultatum/csv-3-exemplum.csv index a80c19d..3099aa4 100644 --- a/testum/resultatum/csv-3-exemplum.csv +++ b/testum/resultatum/csv-3-exemplum.csv @@ -1,7 +1,7 @@ -en-GB,pt-PT, -UN,ONU,"International organization founded in 1945, its mission and work are guided by the purposes and principles contained in its founding Charter. Its chief administrative officer is the Secretary-General." -United Nations,Organização das Nações Unidas, -IFRC,FICV/CV, -International Federation of Red Cross and Red Crescent Societies ,Federação Internacional das Sociedades da Cruz Vermelha e do Crescente Vermelho, -AI,AI,"non-governmental organisation which draws attention to human rights abuses, campaigns for compliance with international laws and standards, and works to mobilise public opinion to put pressure on governments that let abuse take place" -Amnesty International,Amnistia Internacional, +en-GB,pt-PT, +UN,ONU,"International organization founded in 1945, its mission and work are guided by the purposes and principles contained in its founding Charter. Its chief administrative officer is the Secretary-General." +United Nations,Organização das Nações Unidas, +IFRC,FICV/CV, +International Federation of Red Cross and Red Crescent Societies ,Federação Internacional das Sociedades da Cruz Vermelha e do Crescente Vermelho, +AI,AI,"non-governmental organisation which draws attention to human rights abuses, campaigns for compliance with international laws and standards, and works to mobilise public opinion to put pressure on governments that let abuse take place" +Amnesty International,Amnistia Internacional, diff --git a/testum/rursum/XLIFF/hxltm-exemplum-linguam.por-Latn--spa-Latn.tm.hxl.csv b/testum/rursum/XLIFF/hxltm-exemplum-linguam.por-Latn--spa-Latn.tm.hxl.csv index cdb5650..7699a1e 100644 --- a/testum/rursum/XLIFF/hxltm-exemplum-linguam.por-Latn--spa-Latn.tm.hxl.csv +++ b/testum/rursum/XLIFF/hxltm-exemplum-linguam.por-Latn--spa-Latn.tm.hxl.csv @@ -1,10 +1,10 @@ #item+conceptum+codicem,#item+conceptum+indicem_de_terminum,#meta+conceptum,#item+rem+i_pt+i_por+is_latn,#meta+linguam+i_pt+i_por+is_latn,#item+rem+i_es+i_spa+is_latn,#meta+linguam+i_es+i_spa+is_latn -L10N_ego_summarius,Língua portuguesa (alfabeto latino),Idioma español (Alfabeto latino) -L10N_ego_codicem,por-Latn,spa-Latn -L10N_ego_linguam_nomen,Língua portuguesa,Idioma español -L10N_ego_scriptum_nomen,Alfabeto latino,Alfabeto latino -L10N_ego_patriam_UN_M49_numerum,001,001 -L10N_ego_patriam_UN_P_codicem,∅,∅ -I18N_testum_salve_mundi_testum_I18N,Olá mundo!,¡Hola mundo! -I18N_إختبار_טעסט_测试_테스트_испытание_I18N,"Teste, 1, 2, 3","Prueba, 1, 2, 3" -I18N_०१२३४५६७८९_〇一二三四五六七八九十百千万亿_-1234_٩٨٧٦٥٤٣٢١٠_零壹贰叁肆伍陆柒捌玖拾佰仟萬億_I18N,"1, 2, 3, 4, 5, 6, 7, 8, 9, 10","1, 2, 3, 4, 5, 6, 7, 8, 9, 10" +L10N_ego_summarius,1,,Língua portuguesa (alfabeto latino),,Idioma español (Alfabeto latino), +L10N_ego_codicem,1,,por-Latn,,spa-Latn, +L10N_ego_linguam_nomen,1,,Língua portuguesa,,Idioma español, +L10N_ego_scriptum_nomen,1,,Alfabeto latino,,Alfabeto latino, +L10N_ego_patriam_UN_M49_numerum,1,,001,,001, +L10N_ego_patriam_UN_P_codicem,1,,∅,,∅, +I18N_testum_salve_mundi_testum_I18N,1,,Olá mundo!,,¡Hola mundo!, +I18N_إختبار_טעסט_测试_테스트_испытание_I18N,1,,"Teste, 1, 2, 3",,"Prueba, 1, 2, 3", +I18N_०१२३४५६७८९_〇一二三四五六七八九十百千万亿_-1234_٩٨٧٦٥٤٣٢١٠_零壹贰叁肆伍陆柒捌玖拾佰仟萬億_I18N,1,,"1, 2, 3, 4, 5, 6, 7, 8, 9, 10",,"1, 2, 3, 4, 5, 6, 7, 8, 9, 10",