Next Previous Contents

5. wordtrans

wordtrans is the console version.

5.1 Usage

wordtrans [-v] [--help] [--dicts] [--desc] [-d alias] [+w] [-w] 
          [+c] [-c] [+i] [-i] [+g] [-g] [--info-server] [--info-dict]
          [--html] [--html-base page] [--html-link-options options]
          [--conf dir] [--show-charsets] [--charset codec] [--utf8] 
          [--debug] [-l w_lang1 w_lang2] word

-v

Display the version number.

--help

Shows a helping message.

--debug

Shows debugging messages.

--dicts

Displays all available dictionaries. The info will be quite similar to this:

Available dictionaries:
ALIAS      w  c  i  g        FILE
d2e        +  -  -  -  /usr/share/wordtrans/de-es.dict
de-en      +  +  +  -  /usr/share/trans/de-en
i2e        +  -  -  -  /usr/share/i2e/i2e.dict
babylon    =  =  =  =  /usr/share/wordtrans/Engtospa.dic (babylon)
hebreo     =  =  =  =  /mnt/usr/usr/share/wordtrans/Engtoheb.dic (babylon)
dict       =  =  =  =  * (dict)
wordnet    =  =  =  =  wn (dict)

The alias will be used to select a dictionary with option -d. File shows the main dictionary. There are four columns showing the default options, in other words, if below w is the + symbol this means that option +w is the default option. If instead there were a - then the default option would be -w. Idem with +c/-c, +i/-i and +g/-g.

-d alias

Selects the dictionary to use. alias must be one of the shown with option --dicts. It's very important that this option will be the first, because when loading a dictionary its default options will be loaded too. If this option is not used wordtrans will automatically select the default dictionary (the one which is in ~/.wordtrans/preferencias). If the default dictionary couldn't be selected then the first dictionary found will be used. If there's none, wordtrans will exit with an error message.

+w

Only full words will be searched. If you look for "casa" only the terms which contain the full word casa will be shown but not the ones which contain casarse or escasamente.

-w

This is the opposite option of +w.

+c

Case sensitive.

-c

Not case sensitive.

+i

Display second language first.

-i

The opposite of previous option.

+g

Ignore accented vowels.

-g

Doesn't ignore accented vowels.

--charset codec

This specifies the charset that will be used for displaying the messages. By default, it will use an appropriate charset for your locale. You can see all avaiable charsets by using the option --show-charsets.

--utf8

The same as --charset UTF-8.

--show-charsets

Shows all available charsets (which depends on the Qt version you're using).

-l word_language1 word_language2

Append a new entry in the selected dictionary composed of the words indicated and exits. If any word has blanks then the word should be between quotation marks. You must introduce the word in the proper order. If the dictionary is English-Spanish then the first word should be the English one followed by the Spanish one. The new translations will be saved in the personal dictionary.

word

Word or regular expression to look for in the selected dictionary. If the expression contains blanks then it should be between quotation marks. A list will appear with the terms found.

New options have been added to be used mainly by the web interface:

--desc

Shows the description of the selected dictionary (in html).

--info-server

Shows info of the dict server (only if the selected dictionary is of this kind). Generally it will give you info of the dictionaries available in that server.

--info-dict

Ask info to the dict server over the selected dictionary.

--html

Returns a text in HTML format instead of plain text.

--html-base page

Sets the base page of the web interface.

--html-link-options

Sets additional options for generated links.

--conf dir

Directory with the configuration files. This is used in the web interface to read the configuration files from the directory /etc/wordtrans, so wordtrans can be executed as the user nobody.

5.2 Examples

wordtrans -d i2e +w -c +i casa

The word casa will be searched in the dictionary i2e (English-Spanish), with no case sensitive option, displaying in first place the Spanish words. This is the output:

From i2e:
lejos de casa --> afield
casa vendida por pisos --> condominium
casa de huéspedes --> guesthouse
hacia casa --> homeward
casa --> house
casa --> household
ama de casa --> housekeeper
gobierno de la casa --> housekeeping
ama de casa --> housewife
casa del guarda --> lodge
retrete fuera de la casa --> outhouse
casa de empeños --> pawnshop

wordtrans -d i2e -w +i tecla

This will search for the terms which contain the string tecla in the English-Spanish dictionary:

From i2e:
tecla bloqueo de mayúsculas --> caps lock key
pulsar (la tecla del ratón para marcar) --> click (to -)
teclado desmontable --> detachable keyboard
tecla de flecha hacia abajo --> down arrow key
tecla de función --> function key
tecla de inicio --> home key
disposición del teclado --> keyboard layout
teclado numérico --> keypad
teclado numérico --> numeric keyboard
tecla bloqueo de desplazamiento de pantalla --> scroll lock key
tecla de mayúsculas --> shift key
tecla de función programable --> soft key
tecla programable --> soft key
tecla de flecha arriba --> up arrow key
teclado --> keyboard

wordtrans +w -i car

This will search in the default dictionary (in this case i2e) the word car, displaying first the English words:

From i2e:
car --> automóvil
car --> coche
car window --> ventanilla

wordtrans -d de-en hello

Look for hello in the German-English dictionary:

From de-en:
hello --> Hallo!, Guten Tag!
to say hello (to someone) --> (jemandem) guten Tag sagen

wordtrans --debug -d i2e -l fox zorro

Tries to append to the English-Spanish dictionary the entry "fox : zorro" (but in this case it fails):

Debug: fox - zorro are already in the dictionary
Error: can not add new entry to dictionary


Next Previous Contents