Options and Help for Magic-Dic
magic-dic can: search for words and phrases in more then one language
simultaneously, create user dictionaries, also in
multi lingual mode, mails the user dics to the word centre,
installs new dictionaries via Internet, updates user dics,
can also be used to view encyclopedia, shows the email of
author of entry to report report him errors. News of new
translation included.
1.) Usage:
2.) Word Search Options
3.) Extra Search Options
4.) Program Functions: list, mail, write out, get dic, recall
5.) Language Control Options
6.) Disable Options
7.) Help, Configuration, Tutor, NEWS and Update Control Options
8.) Special Functions: utf-8, convert, screw, convert
9.) About Use of Non-Alphanumeric Characters
10.) Files and Directories
11.)How to Create Personal Dictionaries
to jump to a section type e.g.: "/^4"
for full documentation call "di -doc"
-----------------------------------------------------------------------------
1. USAGE:
di [-options] word [+word +...][, word2 [+word +...], ...]
xdi [-xterm ... /] [(rest as di)]
search word form: word, *word* = \#word#, word*, *word
extra search options: [+N][/T / //][-*][iIcm][-b {N}]
language control opt.: [-#][-#+][-#-#]
program options: [CLlgGaArRdDwWtMvhq,qg,qu,qc,qcg,qcu]
disable options: [N NN NC NU NG NL NT]
special options: -u8 -u8c -screw -clean -convert -convert=D
write to dictionary:
di -[#|#+|#-#]
NO order for options and words required! Be chaotic!
-----------------------------------------------------------------------------
2. WORD SEARCH OPTIONS:
word "word" for any kind of word you are looking for. The search
is NOT case sensitive, as long as no capital letters are used.
Capital letters enable case sensitive search. This auto selection
can be overwritten with options "-i", "-I", see below. If
"word" is a single word, only exact matches of "word"
surrounded with non-alphanumeric characters will be printed.
"word" can also be a phrase. NO need to encapsulate
the phrase with ´"´!
*word* exact matching of "word" is opened on the side with the "*"
\#word# ("work*" will find "worker", "*work*" also finds "pieceworker")
This works also for searching in a phrase! Alternatively
"\#word#" can be used. To about this read below "The `*`-Bug"
and see more details about non-alphanumeric characters allowed
and disallowed in Magic-Dic.
wo*d If one or more letters are not known, they can be replaced with
wo#d `#` or `*`. Alternatively the approximate match can be used. See
below option `+N`.
, The ´,´ sets the end of a word OR phrase entry. It can be
exactly right after the "word" with no space, in front of the
next new word or just in between them! It allows
to search for several words right after another with ONE
program call. "*word*," is also allowed! Again, no need to
encapsulate word or phrases with ´"´! The phrase ends with
the last word after a `,` follows as separator to indicate
the next. ("go to, the hell" will hence search first for
all matches "go to" and after for "the hell")
+ `+` can be set in the same way/positions as `,` but indicates
that the word following after have to be in the matches too.
When more words follow after `+` until the end or another
`+` or `,` they will be taken as a phrase that has to be fully
included in the match. "word" can also be set as "*word*".
Note that "+8" is another option (see +N below)! If you need
to specify a single number with `+` set: "+ 8" instead!
-----------------------------------------------------------------------------
3. EXTRA SEARCH CONTROL OPTIONS:
+N approximate search, useful when word is not know exactly.
N is the number of permitted errors in search.
max. 8 permitted and not more than half of the number
of characters in a word. ("+1 worck" will match "work")
-B approximate search, finds the closest match, but is slower
as specifying directly the number of permitted error.
-e {N} if no match in search, extract last character of search word
and search again. At the End of the new search word a "#" is
added to match all word with the stem of the new word. The
search is repeated until the first result is found or the
minimum length is reached with "N" characters of word. If
"N" is not specified the default is "3" characters minimum.
If "N" is set to "0", it will not stop after the first result
and continue until "3" characters minimum are reached.
-E {N} same as "-e {N}" but extracts first character of word. Can be
used together with "-e {N}" function.
/T T is the name or abbreviation of a thematic subject
check with "-t" for all valid subjects ( "/chem" or
"/chemistry" to restrict your search on those subjects)
/ exclude all thematic subjects in search
// opposite of `/`: show only entries that belong to thematic
subjects. Leaves out all unspecified entries.
-i force case insensitive search, overwrites auto-selection
-I forces case sensitive search, overwrites auto-selection
If `-i` and `-I` are set, they abrogate each other and
automatic selection is enabled then again.
-# disable exact word match: "di word -#" is the same as
"di \#word#" (do not mix up with wildcard for dictionary
call in the help above.)
-* same as `-#` (note, that the shell replaces `*` with files
that begins with `-`, use then `-#` instead.)
-c show line numbers
-m show email of creator of this entry (email him if there
is an error with `-M`)
-----------------------------------------------------------------------------
4. PROGRAM FUNCTIONS: list, mail, write out, get dic, recall
-t lists all valid thematic subjects
-r recall the results of the recently last search only.
-o run in loop mode: wait after search for new input. Output
is limited to screen size. See info "-y" to change that.
-b {N} read words from buffer, specified words are ignored.
Without "N" specified, words of all marked lines are
processed line by line as one word request per line.
If "N" is specified as "0", all marked words are processed
word by word. With "N" being greater "1" it limits the
minimum length of a word to "N" characters, to leave out
small words of a full text like, e.g.:"to, of, if, as"
Most non literal character are removed, also numbers.
-y {N} read buffer always. Same as `-b {N}` but does not stop and
processes again, if buffer contents changes, e.g. you mark
a new word. Output manner changes: no stop if list is long.
Instead output is limited to line number of screen. To get out
all, set option "--all", but note that then the stop is disabled.
To force the old manner back, set also `--stop`. Allows
navigation with mouse. Simply double click on a word of the
results.
(stdin) reading from stdin, words are searched word by word, same
as `-b 0`. You can limit the word size setting `-b N`.
To read line by line, just set `-b`. Simple stdin reads
first all input before starting processing to avoid double
searches (batch processing).
--stdin specifying this option runs the data continuesly. (stream
processing). Words that have been looked up, will be looked
up again.
-w write output into a file. Filename is automatically
created from search word and time. No output is shown.
To write out the last search output after a search,
use `-r -w`.
-W file write output into "file". No output is shown.
-M mail to creator of this entry, can be used with `-d`
and `-D` together. If his email address is `PVT`,
the email will be send via Magic-Dic`s mail forward.
-d delete an entry in user dictionaries and emails
a report to the word centre. To enter a new word
just specify a language and leave out the
"word" setting in the command line
-D delete an entry in user AND global installed
dictionaries. Only makes sense, if you have write
permissions, or to report a mistake of a word in a global
dictionary to the word centre. Ignore the warnings then.
-q get list of user and global dictionaries of Magic-Dic server
with number of translations
-qu same as `-q` but limited for user dictionaries only
-qg same as `-q` but limited for global dictionaries only
-qc get list of user and global dictionaries of Magic-Dic server
with numbers of translations and compare with locally installed
dictionaries and calculate difference
-qcu same as `-qc` but limited for user dictionaries only
-qcg same as `-qc` but limited for global dictionaries only
-g get recent users dictionaries from Magic-Dic website.
With no further option the default dictionary is
updated. With "-a" all installed dictionaries are
updated, or with a specific language or pair setting,
just this dictionary is updated. Can be used together
with `-G`. Normal updates keep the data of the old files
and merged them with the new, double entries are removed.
In use with `-def` all data that are not created by the user
are removed, but the users data are kept and merged with the
new source. Updating this way will remove already from database
deleted entries. Otherwise these will be kept.
-gg verbose mode of `-g`, shows all wget logs.
-G similar as "-g" with the difference, to receive
the "global" dictionaries, that are larger than
the user defined. Install a new dictionary with it.
("-G -lat-uk" installs a latin-english dictionary)
Can be used together with `-g`. If used with `-def`
the old dictionary file is removed an only the new installed.
Otherwise the old and new are merged together, sorted and united.
-GG verbose mode of `-G`, shows all wget logs.
-----------------------------------------------------------------------------
5. LANGUAGE CONTROL OPTIONS:
-# set dictionary language, being then completed with the default
language, where # is the DNS country domain name. Get a
list of all set countries with "-L". (If the default language
is english, "-de" will open the german-english dictionary)
More than one setting is allowed. The search will go through
all specified language simultaneously!
-#+ set dictionary language, being completed with all other
languages that are set up. More than one setting allowed.
-#++ same as `-#+` but includes also all other information files
-#-# set two different languages in all wanted combinations.
More than one setting is allowed ("-de-lat" for german
latin)
-def default language pair as set in config file.
-s query server database additionally to local database
-S query only server database, leave out local database
-SS same as `-S` but shows log of wget download
-ss same as `-s` but shows log of wget download
-a sets languages pairs of all installed dictionaries. Information
files as lexicon etc. are not loaded, see option "-aa"
-A sets ALL possible language dictionary pairs (use with care!
may take some time)
-aa set all installed information and dictionary files
-AA set all possible combinations of information and dictionary
files. (use with care! may take some time)
-l list all installed dictionaries
-L list all set up languages. Define your own in conf-file
----------------------------------------------------------------------------
6. DISABLE OPTIONS:
-N disable checking and loading of config file
-NN disable checking for required programs
-NE disable all escape sequences, use this if you have problems
with coloured output or if you want to write the output
into a file without having the escape control sequences
in. ("di work -NE > foo.work") Using the `-w` or `-W`
option does NOT require extra setting of `-NE`.
-NC disable coloured output.
-NA disable automatic remote query
-NU do not load user dictionaries for search
-NUTF do not switch automatically to utf-8 database if $LANG
or $MAGICLANG is set to utf-8.
-NG do not load global dictionaries for search
-NL disable check of windows size and use defaults
-NT set TAB small, that is useful to display an abbreviation
list, where the separator in the middle wastes space
-NTB Do not change terminal bar, when starting "di"
-NR disable automatic removing of empty user dictionaries at
the end of the inserting of new entries to dictionaries.
-NS disable spell check of new inserted words
-NF disable character set format option for spell check
-----------------------------------------------------------------------------
7. HELP, CONFIGURATION, TUTOR, NEWS and UPDATE CONTROL OPTIONS:
-h get this help
-H Switch the Tutor on. Small info about the usage of Magic-Dic will
be displayed in front of every search result. Useful to learn
stepwise how it works.
-HH same as `-H` but does not stop after displaying the tutor info
and continues without expecting to press ENTER
-NH Disable the Tutor.
--help get full documentary of this project
-doc same as --help
-v print out version, licence, and author name
-V compare latest version of `di` on sever with installed (Internet
connection required), display NEWS (motd) of Magic-Dic and offer
automatic installation of latest version of `di`.
-x word NEWS function: show new words for voting and install them
-C start the configuration script to reconfigure or alter your
settings. With option `-def` all default values are set, except
username, password, email.
-www same as `-C` but replaces web-service addresses to new default values
after update
-listcolors list numbers of ANSI colors and text attributes. Colors can
be changed in the "~/.magic-dic/magic-dic.conf" file.
-R remove empty user dictionaries
-VM same as `-V` but installs a monolithic version of Magic-Dic instead
of a modular version. It forces installation, even if no new version
is available.
-VO same as `-V` but installs a modular version of Magic-Dic. It forces
installation, even if no new version is available.
-VV same as `-V` but verbose mode of `wget`. Can be used in addition
to `-VO` and `-VM` also, to force verbose output.
-----------------------------------------------------------------------------
8. SPECIAL FUNCTIONS:
xdi [-term ... /].. "xdi" it opens a new "xterm", "rxvt", "konsole" or what
kind of terminal for X you setup in your conf file
and runs basically a "di -y0" in there, so "di" in a loop to
read out the buffer of mouse. You can add all the options from
"di" to it but when you wish to send options to the xterm, indicate
it with "-term", write then all the options for xterm and indicate
the end with "/". To use utf-8 set "-u8" or "-u8c" depending on
environment. IMPORTANT: set the "-term" option only once and do not
forget the "/"!
-u8 switch to utf-8 database. Use in utf-8 environment. With "xdi"
it starts an utf-8 xterm, but if you are in a non utf-8
environment, use "-u8c" instead. See documentary for details,
how to set automatic.
-u8c switch to utf-8 database and convert input to utf-8 also. Use
when input is not in utf-8, e.g. from buffer, if X is not in
in utf-8 or if file for stdin is not utf-8. For confusion :-):
In non utf-8 X start an "xdi -u8c". In an already utf-8
xterm use only "di -u8 word", but if xterm is in non utf-8 X
start a "di -y0" with "-u8c" to read non utf-8 buffer properly.
-convert convert a dictionary ASCII source file for Magic-Dic
You need also to specify a language and (a) source file(s).
-convert=D same as `-convert` with D being the field separator
different from "space".
-screw screw a Magic-Dic dictionary A-B to B-A. If B-A already exists
in the $PWD the dictionaries will be united, resorted and double
entries will be removed. Specify one or more files with this
option to be processed.
-clean clean Magic-Dic-dictionaries from invalid entries. With no
option, all dictionaries who the user can write to are cleaned.
With language option, all dictionaries of that language are
cleaned. With `!` only user dictionaries are cleaned.
("-clean -de-uk !" cleans the user de-uk dictionary)
With one or more file names, these files are processed instead.
-----------------------------------------------------------------------------
9. ABOUT USE OF NON-ALPHANUMERIC CHARACTERS:
!?%$^§°_- allowed to be used in search in single position or
combination with a word. (how to find out all questions
with word? -> "di feel +?")
-+*/, reserved for this program, use only in the
described way to control the program, only exception
is the `-` that is allows to be used in single position
or in combination with a word, as long it does not match
one of the control sequences. Hence it is not advisable
to start a word that way: "-word", but "word-" is allows
to find all words hyphenated after. To find out all before
use "*-word", this is allows. `/` is the only other character
that can be masked with "*/*", but impossible for `+` and `,`
neither `*`. Do NOT try to mask `-` like "*-*".
&("~`#[\ All these characters should not be used with Magic-Dic,
{;:|><.=@ because they are whether interpreted by the shell or
are in use of this program and cause weird results.
THE `*`-BUG: The shell does interpret the `*` by start up! Do not use it
in single position. The shell will replace the `*` then with
all the file names in your actual directory and these are
probably not the words you are looking for. Also, when you
use the `*` by opening the exact matching and your word will
match to files in your directory, all these files will be
added to your word and the search will fail, what you will
realized when Magic-Dic prompt the word it starts the search
with. In this rare cases, exchange the `*` with a `#` that
will be not interpreted then, although when you put it into
the first position like "#word" the search fails also due to
the shell skips this option to the "di" script. Set the word
including `#` in `"` or escape the `#` like "\#word".
-----------------------------------------------------------------------------
10. FILES AND DIRECTORIES:
global directory : /usr/local/lib/magic-dic/dic/
user directory : ~/.magic-dic/
config file : ~/.magic-dic/magic-dic.conf
mail tmp directory : ~/.magic-dic/mail-tmp/
last search results: ~/.magic-dic/result.tmp
mail out directory : ~/magic-dic-mail
global moduls : /usr/local/lib/magic-dic/lib/
user installed mod.: ~/.magic-dic/lib/
-----------------------------------------------------------------------------
11. HOW TO CREATE PERSONAL DICTIONARIES:
Simply call the program without giving "word", BUT
specify a language! Even for the default language
you have to do: "di -def" will open the user default
dictionary to enter new words in. "di -lat-uk" will
open a user latin-english dictionary. "di -de -fr -lat"
will open dictionaries of the default set language. If this
is english=uk it is the same as "di -de-uk -fr-uk -lat-uk".
Magic-Dic allows to create with one entry step several
dictionaries very easy. Especially multi lingual people
can translate a word in more than one language using the multi
lingual input mode. If the translation allows it, cross linked
dictionaries can be created. If you translate a word from
English to German and French, a german-english,
fresh-english and german-french dictionary will be created.
As more languages you speak, as more the Magic-Dic project
will benefit from providing others with a variety of different
dictionaries. After every entry of a new word, Magic-Dic wants
to email the new words to the word centre, so others can benefit
from that quickly, just by updating their user dics with
"di -g". That way the database can grow easily. Please allow
Magic-Dic to email your words and you will benefit from this also
finally.
Please support this project by translating words you had to
look up in a standard dictionary, because they were not in here.
To put in is pretty easy here and if you need to look it up again
it will be much faster by using Magic-Dic.
Hence, Magic-Dic uses simple ASCII source files for dictionaries
everything is open for everybody and easy to modify. Please support
this open source software.
Thank you. JR