On 8/20/20 1:10 PM, Hans Hagen wrote:
> On 8/20/2020 12:38 PM, Pablo Rodriguez wrote:
>> [...]
>> This time, I have to remove two words, such as in:
>>
>>    string.gsub([[\xmlraw{#1}{.}]]," del ", " "):gsub(" de la ", " ")}
>>
>> But they could be more (and replacements might be added to that list).
>>
>> Is there a more elegant way than appending :gsub()?
>>
>> Is there also a proper way for word scanning?
>>
>> A "word" can be "Word ", " word " " word." " word?" (and so on). I would
>> like to avoid having to code all combinations (of course, if this were
>> already available).
>
> old stuff present for a long time ... probaly documented somewhere ...
> if not than you have to wikify it ...

Many thanks for your reply, Hans.

It is already wikified
(https://wiki.contextgarden.net/Ligatures#Replacements).

I wonder whether \replaceword could be extended to replace multiple
words and also to remove them.

  \starttext

  \replaceword[whatever][this or][no]
  \replaceword[whatever][that][]

  \startlines
  it is this or that
  {\setreplacements[whatever]it is this or that}
  {\setreplacements[whatever]it is this or that}
  it is this or that
  \stoplines

  \stoptext

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to