Le problème est, je crois, ce que le XML de Paratext spécifie et ce qu'il ne spécifie pas. Il spécifie un morceau de texte, l'identifiant de glose (référence croisée au fichier Lexicon.xml) et la position du texte original dans une représentation du flux d'entrée. Il ne préserve pas l'ordre d'apparition. Les versets ne sont pas non plus dans l'ordre.
Un mot ou une phrase donné peut être glosé comme mot(s) ou racine et morphèmes, (bien sûr avec des gloses différentes) et la seule façon de savoir quel homographe est lequel ou quel niveau de glose l'utilisateur attend est via les données de positionnement. Le fichier de glose semble ignorer la casse, la ponctuation et les marques SFM, et probablement d'autres choses aussi.
Ainsi, si le fichier de glose correspond à l'entrée, alors en supposant que Martin a compris la façon non documentée dont Paratext compte les caractères dans sa représentation interne du fichier, alors la bonne chose à faire est de découper l'unité mot/phrase par position et de la remplacer par la glose, en effectuant éventuellement une transposition de casse appropriée.
Si le verset a changé, alors cela ne fonctionne pas. Si la représentation interne du fichier est incorrecte, alors cela ne fonctionne pas.
Toute recherche et remplacement non contraint donnera de fausses correspondances sur les homographes, donc cela ne peut pas être utilisé comme approche générale. Il pourrait y avoir des suppositions, en cherchant des correspondances approximatives plus ou moins quelques caractères, en coupant aux espaces entre les mots, par exemple. Cela coûterait un investissement assez important en temps de programmation, mais il pourrait y avoir des problèmes. Si l'espacement a changé parce que quelqu'un a réorganisé les mots dans le verset, l'homographe décalé de 3 caractères pourrait ne pas être le même mot. Par exemple, le romani a un ordre des mots assez libre :
O Del te del tut haro
(the) God SUBJ give you grace
"May God give you grace"
vs
Te del o Del tut haro
SUBJ give (the) God you grace
"May God give you grace"
PTXprint ne peut pas entrer dans les règles linguistiques de la langue. Même Paratext ne se souvient pas / ne demande pas quelles sont les classes grammaticales des choses. La seule façon fiable d'obtenir des données interlinéaires fiables est que l'utilisateur approuve les gloses.
The problem is, I believe, what Paratext’s XML specifies and what it doesn’t. It specifies chunk of text, gloss-id (cross-referencing the Lexicon.xml file) and the position of the original text in some representatoin of the input stream. It does not preserve the order of occurrence. The verses are not in sequence, either.
A given word or phrase may be glossed as word(s) or stem and morphemes, (of course with different glosses) and the only way to tell which homograph is which or which level of glossing the user expects is via the positioning data. The glossing file seems to ignore case, punctuation and SFM marks, and probably other things too.
Thus if the glossing file matches the input, then assuming that Martin has understood the undocumented way in which Paratext counts characters in its internal representation of the file, then the right thing to do is cut out the word/phrase unit by position and replace with the gloss, possibly doing some case transposition as appropriate.
If the verse has changed, then that doesn’t work. If the internal representation of the file is wrong, then it doesn’t work.
Any unconstrained search and replace is going to get false matches on homographs, so that can’t be used as a general approach. There could be some guessing done, looking for fuzzy-matches plus or minus a few characters, breaking at word-gaps, for instance. That would cost a fairly large investment of programmer time, but there could be problems. If the spacing has changed because someone has reordered the words in the verse, the homograph offset by 3 characters might not be the same word. E.g. Romani has fairly free word order:
O Del te del tut haro
(the) God SUBJ give you grace
"May God give you grace"
vs
Te del o Del tut haro
SUBJ give (the) God you grace
"May God give you grace"
PTXprint can’t go into the linguistics rules of the language. Not even Paratext remembers / asks what parts of speech things are. The only reliable way to get trustworthy interlinear data is for the user to approve glosses.
Traduit automatiquement depuis English Afficher l'original