From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/83 Path: main.gmane.org!not-for-mail From: "W.H. Dekker" Newsgroups: gmane.comp.tex.context Subject: Re: translation of context words: a Perl script Date: Wed, 29 Jul 1998 13:38:15 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <199807291138.NAA01632@servaly.hobby.nl> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035390961 21160 80.91.224.250 (23 Oct 2002 16:36:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:36:01 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: pragma@wxs.nl Xref: main.gmane.org gmane.comp.tex.context:83 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:83 Hans Hagen wrote: > Last week I experimented with something along the same line but with a > different purpose: automatically translating the underlying source into > english, but your solution is as compact as can be! (I don't understand > all the perl in it yet.) I do have a bash script (one of the few that I did not yet translate to Perl) that I use to replace words in texts. It takes words and their translations from a words list. Perhaps I should now make a Perl script from it. Here is the heading of the bash script: #!/bin/bash # translate - translate file(s) according to a list of word pairs # occurrences of the first words are replaced by the second words only # full words are replaced, using the ex \ search pattern # however, if the -l option is given, a literal translation is made by # putting the word pairs literally in the sed script, including # special characters. Thus the pair: # .a.b. abcd # replaces any sequence of five characters with a second character "a" # and a fourth character "b" (even those that are not single words) # with "abcd". -- Hartelijke groet, Wybo ===================Servalys Analytical Chemistry Services================= Wybo H. Dekker | Deilsedijk 60 | tel (31)345-652164 wybo@servaly.hobby.nl | 4158 CH Deil, The Netherlands | fax (31)345-652383