[CC: apertium-stuff mailing list]
1) Drop APy and instead read the translator mode directly and inject what you need into it. For example, translating a text snippet spa-cat is actually a call to: $ echo "Soluciones y servicios de Ingeniería" | apertium-destxt | bash /usr/share/apertium/modes/spa-cat.mode -g | apertium-retxt If you open /usr/share/apertium/modes/spa-cat.mode you can see all the steps it performs. A document translation injects some steps into that, becoming: $ tf-extract input.docx | bash <(apertium-wblank-mode /usr/share/apertium/modes/spa-cat.mode) -g | tf-inject > output.docx If you run "apertium-wblank-mode /usr/share/apertium/modes/spa-cat.mode" alone you can see that it injects apertium-wblank-attach and apertium-wblank-detach (and a few other changes for other pairs). The full chain is thus 13+ smaller programs run in a pipe, and you can step in at any point in that pipe to do your transformations. 2) Yes. That can be done with either https://wiki.apertium.org/wiki/Dialectal_or_standard_variation (best option) or https://wiki.apertium.org/wiki/Translation_memory -- Tino Didriksen On Thu, 20 Feb 2025 at 08:39, Víctor Sandín Vega <vsan...@astibot.es> wrote: > Good morning, > > I'm sorry to bother you, but I've seen that you are the person who commits > to the Apertium project. I'm using Apertium in a project for the university > and I have a couple of questions that I'd like to ask you. > > 1- I have implemented entity detection with Spacy and in the translation > of texts and websites, I was able to apply it to the received text and it > works correctly. The problem comes with the translation of documents, as in > the call to Apertium the file is passed: > > proc = tornado.process.Subprocess(cmd, > stdin=file_to_translate, > stdout=tornado.process.Subprocess.STREAM, > env=env) > > (Source translate_doc.py) > > I can't really access the texts in that file, and I'd like to know > if I can make any changes to the part of Apertium that receives that cmd > call and if so, which part actually receives that call. > > > 2- I have a translation based on "User Group" and I wanted to know if > there was a way to implement it. It would be like having a section in the > dictionary that included "special words" or different translations for a > certain group of users. For example, for a doctor I would use more > technical words than for a normal user. > > Thanks for your help > Víctor
_______________________________________________ Apertium-stuff mailing list Apertium-stuff@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/apertium-stuff