Subversion Repositories LCARS

Rev

Blame | Last modification | View Log | RSS feed

1

EasyTranslator 0.95a - Stream editor to manage dictionary files
Requires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATH

Copyright (C) 2001  Thomas Lahn (webmaster@PointedEars.de)
Be sure to have 'easyTrans' or similar in mail subject line for fast response.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program (COPYING file); if not, write to the
Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


EasyTranslator 0.95a - Stream editor to manage dictionary files
Requires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATH

translate EXPRESSION DICTIONARY [OPTIONS]

Tries to translate EXPRESSION looking up DICTIONARY and writes the result
to standard output (stdout) in a single line followed by a newline (\n).

Environment:

TRANSLATE_DIR     Dictionary folder root (absolute path '/')
                  If undefined, this is the program directory
                  (currently './').
TRANSLATE_OPTIONS Default options to overwrite command-line options

Arguments:

EXPRESSION        Word or (double-quoted) phrase to be translated
DICTIONARY        Path of dictionary file relative to TRANSLATE_DIR

Translation OPTIONS:
  -b, --brackets  If not in DICTIONARY, writes given WORD or EXPRESSION
                  as [WORD] or [EXPRESSION].
  -m, --messages  Return error messages instead of null-strings.
  -p, --phrase    Translate EXPRESSION as entire phrase. If not given,
                  each WORD of EXPRESSION is translated seperately.
  -r, --reverse   Perform reverse translation. Recommended only if
                  no appropriate dictionary file for vice-versa translation is
                  available and -p is also used.
  -s, --sound     Beep on fatal errors.
  -v, --verbose   Display flow of operation. Includes -m behavior.
  -z, --zero      Return not translatable tokens as null-strings.
                  Overwrites -b.

translate EXPRESSION DICTIONARY COMMAND TRANSLATION [INFO] [OPTIONS]
translate COMMAND DICTIONARY [INFO] [OPTIONS]

Dictionary file COMMANDs:
  -a, --add       If not in DICTIONARY, add EXPRESSION with TRANSLATION
                  to DICTIONARY and write TRANSLATION.
                  If DICTIONARY not exists, create the file with INFO
                  and add the entry; if INFO is a null-string,
                  default INFO is added, containing program version,
                  user name and timestamp. Requires 'sort'.
  -ai, -addinfo   Add information data INFO to DICTIONARY.
                  Must be used as first argument.
  -c, --create    Create new DICTIONARY with INFO (see -a).
                  Existing files are replaced. Must be used as first argument.
  -d, --delete    If used with EXPRESSION and DICTIONARY, remove EXPRESSION
                  from DICTIONARY instead of translating.
                  If used as first argument, delete DICTIONARY.
  -i, --info      Display information about DICTIONARY.
                  Must be used as first argument.

  -o, --overwrite Like -a but overwrite a contained translation of
                  EXPRESSION with TRANSLATION without question.
                  Additionally requires 'mktemp'.
  -R, --repair    Repair DICTIONARY instead of translating. Requires 'mktemp'.
                  Info data is be kept but invalid entries are removed.
                  USE WITH CAUTION!
  -s, --sort      Sort DICTIONARY instead of translating. Requires 'sort'.
                  Includes --sound when used with -v.
                  Must be used as first argument.

translate OPTION [OPTION]

Help page OPTIONs:
  --1             Display help on one page (without 'clear' and user input).
                  Useful with redirection 
                  (try 'translate --1 --? > translate.doc.txt').
                  Must be given before all other help page options.
  --a, --about    Display information about the program.
  --c, --cmd      Display this help page.
  --d, --dict     Display help about dictionary files.
  --dev, --emp    Display special information for developers and employers.
  --x, --example  Display example.
  --?, --help     Display all help pages.


EasyTranslator 0.95a - Stream editor to manage dictionary files
Requires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATH

EXAMPLE: If you would like to translate the English words 'a few' into German,

        translate ''a few'' en-de

should write the German words

        ein(e) wenig(e)\n

(without indent) to stdout if the echo dictionary file 'en-de' contains
a correct entry for it (see next page). You may also translate it as
entire phrase (which seems to make more sense here):

        translate ''a few'' en-de -p

should instead write the German word 'einige\n'
(replace '' in input with the double-quote character).


EasyTranslator 0.95a - Stream editor to manage dictionary files
Requires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATH

DICTIONARY FILES:
You may create/improve dictionary files to be used with EasyTranslator
of your own. Translation data must be contained therein as follows:

#:File description displayed when option -i is used\n[#:File description\n]
[Expression:translation\n[Next expression:next translation\n]]
Last expression:last translation\z

Parts enclosed in rectangle brackets are optional. The colon (:) is to be used
as delimiter character between original and translated expression only.
Dictionary file names should contain common language identifiers separated
by a dash (such as 'en-de.dic' for an English-German dictionary file).

Program updates and dictionaries can be obtained from
'http://pointedears.de/dev/unix/translate/'.
Thank you for using a program by PointedEars.


EasyTranslator 0.95a - Stream editor to manage dictionary files
Requires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATH

Copyright (C) 2001  Thomas Lahn (webmaster@PointedEars.de)
Be sure to have 'easyTrans' or similar in mail subject line for fast response.

INFORMATION FOR DEVELOPERS (KNOWN ISSUES)...

1) As I have not found out the correct /REGEXP/ for 'sed' to remove all
   characters before/after another one including this character (delimiter)
   to date, removing each single printable character before/after
   delimiter is, for the time being, my only solution in bash. Please mail
   me if you have a more efficient solution, especially the correct /REGEXP/.
2) Sorting the dictionary unfortunately also sorts its the info data by now.

...AND FOR EMPLOYERS:

BTW, if you have an idea for improving EasyTranslator or for another (field of)
application you want me to develop for you (BASIC, DOS batch, Windows INF,
Visual Basic, bash, Pascal, Delphi, C, HTML/JavaScript, and I am still learning
other languages) feel free to mail me, too. THNX!    -- PointedEars, 2001-03-28