Rev 15 | Blame | Compare with Previous | Last modification | View Log | RSS feed
EasyTranslator 0.95a - Stream editor to manage dictionary filesRequires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATHCopyright (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 modifyit under the terms of the GNU General Public License as published bythe 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program (COPYING file); if not, write to theFree Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.EasyTranslator 0.95a - Stream editor to manage dictionary filesRequires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATHtranslate EXPRESSION DICTIONARY [OPTIONS]Tries to translate EXPRESSION looking up DICTIONARY and writes the resultto 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 optionsArguments:EXPRESSION Word or (double-quoted) phrase to be translatedDICTIONARY Path of dictionary file relative to TRANSLATE_DIRTranslation OPTIONS:-b, --brackets If not in DICTIONARY, writes given WORD or EXPRESSIONas [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 ifno appropriate dictionary file for vice-versa translation isavailable 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 TRANSLATIONto DICTIONARY and write TRANSLATION.If DICTIONARY not exists, create the file with INFOand 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 EXPRESSIONfrom 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 ofEXPRESSION 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 filesRequires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATHEXAMPLE: If you would like to translate the English words 'a few' into German,translate ''a few'' en-deshould write the German wordsein(e) wenig(e)\n(without indent) to stdout if the echo dictionary file 'en-de' containsa correct entry for it (see next page). You may also translate it asentire phrase (which seems to make more sense here):translate ''a few'' en-de -pshould instead write the German word 'einige\n'(replace '' in input with the double-quote character).EasyTranslator 0.95a - Stream editor to manage dictionary filesRequires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATHDICTIONARY FILES:You may create/improve dictionary files to be used with EasyTranslatorof 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\zParts enclosed in rectangle brackets are optional. The colon (:) is to be usedas delimiter character between original and translated expression only.Dictionary file names should contain common language identifiers separatedby 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 filesRequires 'basename', 'grep' and 'sed', optionally 'sort' and 'mktemp' in PATHCopyright (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 allcharacters before/after another one including this character (delimiter)to date, removing each single printable character before/afterdelimiter is, for the time being, my only solution in bash. Please mailme 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 learningother languages) feel free to mail me, too. THNX! -- PointedEars, 2001-03-28