--------------------------------Linux Guide----------------------------------
by Ingo Blechschmidt (c) 2002
-----------------------------------------------------------------------------
------------------------- Wörterbuch
------------------------- Son Jun 17 13:33:55 MEST 2001
------------------------- Wörterbuch Vokabeln Englisch->Deutsch Deutsch->Englisch grep
voc.bz2 wb
-----------------------------------------------------------------------------
Sie lesen eine Manpage durch, da fehlt Ihnen eine Englisch-Vokabel.
Dieser Artikel stellt ein Skript vor, welches schnell ein Wörtebuch zu
Verfügung stellt.
-----------------------------------------------------------------------------
Zuerst brauchen Sie eine Wörterliste. Die gibt es zum Beispiel bei
siehe <"http://www.wh9.tu-dresden.de/~heinrich/dict/dict_leo_ftp/leo_ftp/">http://www.wh9.tu-dresden.de/~heinrich/dict/dict_leo_ftp/leo_ftp/.
Das schon fertig konvertierte Wörterbuch gibt's
siehe <"down/voc.bz2">hier. Das Listing, zu speichern unter
/home/progs/wb/wb.sh:
--------CODE--------: wb.sh
#!/bin/bash
# wb.sh - Wörterbuch
# (c) by Ingo Blechschmidt, Son Jun 17 13:42:00 MEST 2001
#
# 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; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Ingo Blechschmidt
# Arberstraße 5
# 86179 Augsburg
# E-Mail: iblech@web.de, http://www.way.to/uselinux/
# Tel.: +49 / 821 882955
#
#
WBDIR=/home/progs/wb
if [ $# -ne 1 ]; then
echo "Usage: $0 \"string string ...\""
echo " $0 string"
echo " $0 regexp"
exit 1
else
bunzip2 -cd $WBDIR/voc.bz2 | grep -hi "$1"
fi
--------/CODE--------
Wenn Sie nun noch einen symbolischen Link von dem Shell-Skript nach
/usr/local/bin/wb setzen (ln -s /home/progs/wb/wb.sh
/usr/local/bin/wb), steht es nun zu Verfügung. Beim Abfragen,
entpackt einfach bzip2 das Wörterbuch, und schreibt es in eine Pipe. grep sucht
dann die betreffenden Wörter heraus.
Folgendes vim-Skript hilft bei der Integrierung in den Standard-Unix-Editor:
--------CODE--------: vim-Skript
map :!wb
--------/CODE--------
Wenn man nun drückt, wird das Word, auf dem der Cursor ist,
übersetzt.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
This document is distributed under the terms of the GNU Free Documentation
License.