Start a new topic

Seals on the Beach

image


Any seals on the beach, in Kolobrzeg?


With the great help of JMichaelTX I've added some lines to the Keyboard Maestro DeepL macro to replace wrong words with correct words in DeepL's output via the API.


https://youtu.be/x6MpFxxcwKs


You'll need a glossary (e.g. DeepL-out.txt) with replacement terms and of course you need to set the path to the correct location of this glossary.


Have fun with this macro!

txt
(87 Bytes)

1 person has this question

Had some seals again, this morning. And washing machines!


Make sure that you structure the replacement file the right way:


longer forms (e.g. plural) should come before shorter forms (e.g. singular), since the replacement doesn't respect word boundaries.


Example:


image


The one entry 'zeehond' will handle both the singular and plural of zeehond (seal) correct.

For 'wasmachine' (washer/washing machine), there are two entries necessary, the longer one comes first.



2 people like this

Please note: You'll need Keyboard Maestro 8 for this macro!

 Well done :-)

I encountered one problem yesterday, with the blacklist macro.
My French blacklist.txt contained "mil", to replace with "millet".
Problem: "mil" was also replaced with "millet" in words containing the "mil" characters (like in familles, which became "familletles".
I still don't know how to fix this, so I removed "mil" from my list.
Hans, can you think of any solution?
If not, you (or I) can ask JMichaelTX for some help...? It must be very simple, probably something like inserting the "^" and "$" characters somewhere below in the macro.

image


Wouldn't simply be adding word borders to potential items in the blacklist do?


\bmil\b


Implying it in the existing macro may be difficult. If the blacklist only consists of single words, the adding borders thing might work there as well.


H.

woorden: Wouldn't simply be adding word borders to potential items in the blacklist do?

 

I tried... and it worked :-)

Thanks a lot woorden, CT's got talent!♩♪♫

Yeah, the two Hanses are like Statler and Waldorf. Always fun with them.
With this script you can store your seals in an external file! Osax is needed... https://forum.keyboardmaestro.com/uploads/default/original/2X/3/3b35ecaa1c3cc192cf8ae28efbe428ad9b9e348f.png
CTrainer, I'm lost. What do you mean by "external file"? How is is different from our blacklist.txt file?

 

You’re right again. Please ignore.
Login to post a comment