Skip to content

Commit

Permalink
hxltmcli (#24): --tmeta-archivum; Terminologium Multilinguam (priore …
Browse files Browse the repository at this point in the history
…HXL Trānslātiōnem Memoriam)
  • Loading branch information
fititnt committed Oct 19, 2021
1 parent 50b21f9 commit 3b75806
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 27 deletions.
12 changes: 6 additions & 6 deletions bin/hxltmcli
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,11 @@ class HXLTMCLI: # pylint: disable=too-many-instance-attributes
)

parser.add_argument(
'--meta-archivum',
'--tmeta-archivum',
help='(Draft, not fully implemented) ' +
'Optional YAML metadata for advanced processing operations.',
# dest='fontem_linguam',
metavar='meta_archivum',
metavar='tmeta_archivum',
action='store',
# default='lat-Latn',
nargs='?'
Expand Down Expand Up @@ -1563,7 +1563,7 @@ class HXLTMArgumentum: # pylint: disable=too-many-instance-attributes
Argūmentum dēfīnītiōnem ad Vēnandum īnsectum
[lat-Latn]_
"""
meta_archivum: InitVar[str] = None
tmeta_archivum: InitVar[str] = None
tmeta: InitVar[dict] = None
agendum_linguam: InitVar[List[Type['HXLTMLinguam']]] = []
auxilium_linguam: InitVar[List[Type['HXLTMLinguam']]] = []
Expand Down Expand Up @@ -1629,11 +1629,11 @@ class HXLTMArgumentum: # pylint: disable=too-many-instance-attributes
args_rem.objectivum_normam:
self.objectivum_normam = args_rem.objectivum_normam

if hasattr(args_rem, 'meta_archivum') and \
args_rem.meta_archivum:
if hasattr(args_rem, 'tmeta_archivum') and \
args_rem.tmeta_archivum:
# TODO: make a bit more structured this file load

file_ = open(args_rem.meta_archivum, mode='r')
file_ = open(args_rem.tmeta_archivum, mode='r')
# self.objectivum_formulam_crudum = file_.read()
self.tmeta = yaml.safe_load(file_)
file_.close()
Expand Down
34 changes: 33 additions & 1 deletion hxltm/archivum/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,22 @@ include::../../bin/hxltmdexml[tag=epilogum]

[#HXLTM]
=== `+HXLTM+`
==== HXL Trānslātiōnem Memoriam
==== Terminologium Multilinguam (priore HXL Trānslātiōnem Memoriam)

////
Naming the HXL TM
Terminologium Multilinguam
- https://en.wiktionary.org/wiki/terminus#Latin
- https://en.wiktionary.org/wiki/logium#Latin
- https://en.wiktionary.org/wiki/multi-#English
- https://en.wiktionary.org/wiki/lingua#Latin
- https://en.wiktionary.org/wiki/multilingual
lingua
////



[source,yaml]
----
Expand Down Expand Up @@ -116,6 +131,23 @@ include::../../ontologia/cor.hxltm.yml[tag=normam_HXLTM-ASA]
----


===== Command line examples

[source,bash]
----
include::../../testum/hxltm/disciplinam-manuale-anglicum.sh[tag=HXLTM-ASA]
----

[#HXLTM-TMETA]
=== `+HXLTM-TMETA+`:
==== HXLTM Terminologiam

[source,yaml]
----
include::../../ontologia/cor.hxltm.yml[tag=normam_HXLTM-ASA]
----


===== Command line examples

[source,bash]
Expand Down
2 changes: 1 addition & 1 deletion ontologia/cor.hxltm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ normam:
- <https://hdp.etica.ai/hxltm>
# end::normam_HXLTM[]

#### HXLTM: HXL Trānslātiōnem Memoriam ______________________________________
#### HXLTM: Terminologium Multilinguam Abstractum Syntaxim Arborem ___________
# tag::normam_HXLTM-ASA[]
HXLTM-ASA:
__meta:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"__tmeta__": "{{ 'aaaa' }}",
"argumentum": {{ argumentum }},
"globum": {{ globum }},
"tmeta": {{ tmeta }},
"argumentum": "{{ argumentum }}",
"globum": "{{ globum }}",
"tmeta": "{{ tmeta }}"
}
19 changes: 11 additions & 8 deletions testum/hxltm/hxltm-exemplum-linguam.tmeta.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# hxltm-exemplum-linguam.tmeta.yml
# HXLTM Datum: hxltm-exemplum-linguam.tm.hxl.csv

tmeta:
# _[eng-Latn]
# Global Vars for templating. This will add tho the ones from
# cor.hxltm.yml:normam:YourDataConventionHere
# [eng-Latn]_
globum:
tbx:
titulum: TBX-Basic Sample File

# _[eng-Latn]
# "_" is a language and script neutral variable used for global variables
#
# On reference hxltm implementation, values here will be exported as _global_
# So {{ globum.tbx.titulum }} = "TBX-Basic exemplum"
# [eng-Latn]_
_:
glossarium_titulum: TBX-Basic exemplum
tbx:
titulum: TBX-Basic exemplum
12 changes: 8 additions & 4 deletions testum/hxltm/hxltmcli--help_eng-Latn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ usage: hxltmcli [-h] [--sheet [number]] [--selector [path]]
[--non-agendum-linguam non_agendum_linguam]
[--auxilium-linguam auxilium_linguam]
[--fontem-normam [fontem_normam]]
[--tmeta-archivum [tmeta_archivum]]
[--objectivum-normam [objectivum_normam]]
[--objectivum-formulam OBJECTIVUM_FORMULAM]
[--objectivum-HXLTM] [--objectivum-TMX]
Expand All @@ -33,7 +34,7 @@ usage: hxltmcli [-h] [--sheet [number]] [--selector [path]]
[--venandum-insectum-est]
[infile] [outfile]

_[eng-Latn] hxltmcli v0.8.6 is an implementation of HXLTM tagging conventions
_[eng-Latn] hxltmcli v0.8.7 is an implementation of HXLTM tagging conventions
on HXL to manage and export tabular data to popular translation memories
and glossaries file formats with non-close standards.
[eng-Latn]_"
Expand Down Expand Up @@ -87,16 +88,19 @@ optional arguments:
(Brazil, adm1, Minas Gerais State, uses PCode);
076_BR3106200 (Brazil, adm2, Belo Horizonte city, uses
PCode).
--tmeta-archivum [tmeta_archivum]
(Draft, not fully implemented) Optional YAML metadata
for advanced processing operations.
--objectivum-normam [objectivum_normam]
(For data exchange) Target of data convention
Recommended convention: use "{UN M49}_{P-Code}" when
endorsed by regional government, and reverse domain
name notation with "_" for other cases. Example:
org_hxlstandard
--objectivum-formulam OBJECTIVUM_FORMULAM
(Draft, not implemented) Template file to use as
reference to generate an output. Less powerful than
custom file but can be used for simple cases.
Template file to use as reference to generate an
output. Less powerful than custom file but can be used
for simple cases.
--objectivum-HXLTM, --HXLTM
Save output as HXLTM (default). Multilingual output
format.
Expand Down
17 changes: 13 additions & 4 deletions testum/hxltm/manuale-testum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# DESCRIPTION: Manual testum for hxltmcli.
# This file can also be used to undestand how the output
# of testum/hxltm/resultatum was created
# DEPRECATED. Use the disciplinam-manuale-anglicum.sh
# (both used for testing and generate documentation)
#
# OPTIONS: ---
#
Expand Down Expand Up @@ -36,9 +38,11 @@ HXLTM_EXEMPLUM_XLSX_GSHEETS="https://docs.google.com/spreadsheets/d/1isOgjeRJw__

# HXLTM_EXEMPLUM_LINGUAM_LOCAL="${ROOTDIR}/hxltm-linguam.tm.hxl.csv"
HXLTM_EXEMPLUM_LINGUAM_LOCAL="hxltm-exemplum-linguam.tm.hxl.csv"
HXLTM_EXEMPLUM_LINGUAM_LOCAL_TMETA="hxltm-exemplum-linguam.tmeta.yml"
HXLTM_EXEMPLUM_LINGUAM_GSHEETS="https://docs.google.com/spreadsheets/d/1isOgjeRJw__nky-YY-IR_EAZqLI6xQ96DKbD4tf0ZO8/edit#gid=1241276648"

HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL="resultatum/hxltm-exemplum-linguam.tmx"
HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TBX_LOCAL="resultatum/hxltm-exemplum-linguam.tbx"
HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_XLIFF_LOCAL="resultatum/hxltm-exemplum-linguam.xlf"

# .gitignore: Do not save production test files to save space outside hapi.etica.ai
Expand Down Expand Up @@ -73,11 +77,15 @@ printf "\n\n\n\tTESTUM 003 HXLTM_EXEMPLUM_XLSX_LOCAL\n\n"
echo "hxltmcli --sheet 2 $HXLTM_EXEMPLUM_XLSX_LOCAL | grep L10N_ego_codicem"
hxltmcli --sheet 2 "$HXLTM_EXEMPLUM_XLSX_LOCAL" | grep L10N_ego_codicem

# printf "\n\n\n\tTESTUM 004 HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL\n\n"
# echo hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL" --objectivum-TMX
# hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL" --objectivum-TMX
printf "\n\n\n\tTESTUM 004 HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL\n\n"
echo hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL" --objectivum-TMX
hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL" --objectivum-TMX

printf "\n\n\n\tTESTUM 005 HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_XLIFF_LOCAL\n\n"
printf "\n\n\n\tTESTUM 004 HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TMX_LOCAL\n\n"
echo hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TBX_LOCAL" --objectivum-TBX-Basim --tmeta-archivum "$HXLTM_EXEMPLUM_LINGUAM_LOCAL_TMETA"
hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_TBX_LOCAL" --objectivum-TBX-Basim

printf "\n\n\n\tTESTUM 006 HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_XLIFF_LOCAL\n\n"
echo hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_XLIFF_LOCAL" --objectivum-XLIFF
hxltmcli "$HXLTM_EXEMPLUM_LINGUAM_LOCAL" "$HXLTM_EXEMPLUM_LINGUAM_RESULTATUM_XLIFF_LOCAL" --objectivum-XLIFF

Expand Down Expand Up @@ -131,5 +139,6 @@ hxltmcli schemam-un-htcds.tm.hxl.csv --objectivum-formulam formulam/exemplum-lin
# hxltmcli hxltm-exemplum-linguam.tm.hxl.csv --meta-archivum hxltm-exemplum-linguam.tmeta.yml
# hxltmcli hxltm-exemplum-linguam.tm.hxl.csv --meta-archivum hxltm-exemplum-linguam.tmeta.yml --objectivum-formulam formulam/exemplum-linguam.🗣️.json
# hxltmcli hxltm-exemplum-linguam.tm.hxl.csv --meta-archivum hxltm-exemplum-linguam.tmeta.yml --objectivum-formulam formulam/exemplum-linguam-tmeta-testum.🗣️.json
# hxltm-exemplum-linguam.tm.hxl.csv --tmeta-archivum hxltm-exemplum-linguam.tmeta.yml --objectivum-formulam formulam/exemplum-linguam-tmeta-testum.🗣️.json

exit 0

0 comments on commit 3b75806

Please sign in to comment.