Just another IT weblog

Babylon su Linux?

Aprile 6th, 2007 by Mattneri

Una cosa di cui ho sempre sentito la mancanza su linux è un degno sostituto di Babylon, non tanto per il programma in se ma per i dizionari veramente completi utilizzati da tale programma.

Una fra le migliori alternative utilizzabili sotto Linux consiste in Stardict. Il software di per se è molto buono, ma purtroppo non si può dire la stessa cosa per i file dizionario presenti per tale applicativo.

Quindi immaginerete voi la gioia quando nei giorni scorsi mi sono imbattuto in dictconv, un progetto opensource che permette la conversione dei file dizionario di babylon (.bgl) in vari altri formati (tra i quali quello utilizzato da Stardict).

Una volta scaricati i sorgenti dal precedente link (al momento non vi sono deb o rpm) il processo di compilazione è abbastanza immediato. Estraete i sorgenti e spostatevi nella directory dei sorgenti.

$ ./configure

$ make all install

Per utilizzarlo la sintassi è la seguente:

$ dictconv -o output.ext input.ext

Ad esempio se volete convertire un file di Babylon in uno utilizzabile da Stardict:

$ dictconv -o eng_ita.ifo eng_ita.bgl

StarDict

Nota del 01/07/07:

In questo articolo ho postato una nuova versione non ufficiale di dictconv, nella quale ho fixato alcuni fastidiosi bachi che affliggevano il programma.

Posted in Linux |

27 Responses

  1. gianni Says:

    Grande! Era veramente da molto che cercavo qualcosa del genere

  2. Egregorion Says:

    Finalmente, io uso ktranslator (grande software anche questo, con ocr e speech incorporato) in kde e stardict in gnome. Effettivamente mancava un buon dizionario.

    Regards

  3. Neo Says:

    E’ possibile avere un link ai file bgl? Ho installato Babylon su Windows ma trovo solo i bdc, non i bgl… gli unici bgl che trovo sono di pochi kB!

  4. Mattneri Says:

    Io li ho scaricati da qui.
    http://www.babylon.com/gloss/glossaries.html

  5. Neo Says:

    Grazie mille! :)

  6. sonia Says:

    mi da un errore, libxml2 nn installato, anche se c’e’.
    potresti mettere a disposizione i dizionari gia’ convertiti?
    mi servono ita-eng e eng-ita
    grazie

  7. Mattneri Says:

    Devi installare il pacchetto libxml2-dev (molto probabilmente hai installato solamente libxml2).

  8. Egregorion Says:

    Penso di aver risolto i problemi che affliggono la conversione di alcuni dizionari, tipo “Babylon_English_Italian”.

    Se qualcuno mi suggerisce il metodo per trasformare un plaintext nel formato stardict avremo tutti i dizionari funzionanti.

    Per quanto riguarda ktranslator io ho convertito i dizionari in plaintext e poi li ho passati al setaccio con sed in modo da togliere i caratteri non validi.

    Se mi aiutate faccio anche un howto.

    Regards

  9. Egregorion Says:

    Come avevo promesso ho finito l’how-to, qui il link:
    http://www.egregorion.net

    Regards

  10. Mattneri Says:

    Grazie Egregorion bella guida!

  11. Atcold Says:

    Aiutooo!! Sono un ex windowsiano, che tenta di trovare un sostituto a Babylon.. ma quando mi si dice “Estraete i sorgenti e spostatevi nella directory dei sorgenti.” l’unica cosa che posso dire e’: “Ehhhhh?”
    Tralasciando, ho scaicato l’rpm, ho usato il comando “rpm -i”, pero’ mi e’ comparsa una lista immensa di errori, del tipo “rpm -i stardict-2.4.8-1.i386.rpm
    error: Failed dependencies:
    /bin/sh is needed by stardict-2.4.8-1.i386
    bonobo-activation >= 2.2.0 is needed by stardict-2.4.8-1.i386
    libICE.so.6 is needed by stardict-2.4.8-1.i386
    libORBit-2.so.0 is needed by stardict-2.4.8-1.i386
    libSM.so.6 is needed by stardict-2.4.8-1.i386
    libX11.so.6 is needed by stardict-2.4.8-1.i386
    libart_lgpl_2.so.2 is needed by stardict-2.4.8-1.i386
    libatk-1.0.so.0 is needed by stardict-2.4.8-1.i386
    libbonobo >= 2.2.0 is needed by stardict-2.4.8-1.i386
    libbonobo-2.so.0 is needed by stardict-2.4.8-1.i386
    libbonobo-activation.so.4 is needed by stardict-2.4.8-1.i386″ ecc. Aiutatemi voi, ne ho parecchio bisogno!!
    (Cmq, non sono un impedito in informatica, anzi programmicchio piuttosto bene in c++ =D) Grazie delle collaborazione!

  12. Mattneri Says:

    Gli errori derivano da un sacco di librerie mancanti. Dovresti prima di tutto installarti le singole lib.

    Ad ogni modo x quanto riguarda i sorgenti. Basta che scompatti il tar.gz in una directory a tua scelta e poi da terminale segui le istruzioni sopra riportate. Il comando per spostarsi nelle varie directory del filesystem su linux e’ cd (ad es. cd /home/mattneri/Desktop)

  13. Atcold Says:

    Ok, fin qui c’ero arrivato.. dato che mi sembreva molto lungo il processo di scaricamento di tutte quelle lib, ho optato per installare stardic con adept (uso correntemente Kubuntu). Mi sono cimentato poi con l’installazione di dictconv, pero’ ad un certo punto, dopo aver digitato ./configure si blocca ed esce una scritta, dopo molte altre, del tipo :”checking for xml2-config… no
    checking for libxml - version >= 2.5.0… no
    *** The xml2-config script installed by LIBXML could not be found
    *** If libxml was installed in PREFIX, make sure PREFIX/bin is in
    *** your path, or set the XML2_CONFIG environment variable to the
    *** full path to xml2-config.
    configure: error: You must have libxml2 >= 2.5.0 installed”. Bene, senza perdermi d’animo vado su adept, e prontamente mi metto alla ricerca della libreria mancante che… a quanto posso constatare e’ gia’ ben che installata! Sia “libxml2″ che “python-libxml2″ ci sono. A questo punto mi domando: “Ma cosa diavolo devo fare?” Vi ringrazio ancora dell’aiuto!

  14. Mattneri Says:

    installa libxml2-dev
    Da terminale:
    sudo apt-get install libxml2-dev

    Poi riprova ad installare dictconv

  15. Atcold Says:

    “Ed un passo si fece, superando il primo ostacolo.”
    Bene, ora siamo al momento del “make”: cio’ che compare e’ il seguente testo (il mio nick e’ atcold, ed il portatile e’ atcold-laptop).
    “atcold@atcold-laptop:~/Desktop/Dizionario/dictconv-0.2$ make all install
    make all-recursive
    make[1]: Entering directory `/home/atcold/Desktop/Dizionario/dictconv-0.2′
    Making all in src
    make[2]: Entering directory `/home/atcold/Desktop/Dizionario/dictconv-0.2/src’
    make[2]: Nothing to be done for `all’.
    make[2]: Leaving directory `/home/atcold/Desktop/Dizionario/dictconv-0.2/src’
    make[2]: Entering directory `/home/atcold/Desktop/Dizionario/dictconv-0.2′
    make[2]: Leaving directory `/home/atcold/Desktop/Dizionario/dictconv-0.2′
    make[1]: Leaving directory `/home/atcold/Desktop/Dizionario/dictconv-0.2′
    Making install in src
    make[1]: Entering directory `/home/atcold/Desktop/Dizionario/dictconv-0.2/src’
    make[2]: Entering directory `/home/atcold/Desktop/Dizionario/dictconv-0.2/src’
    /bin/bash ../mkinstalldirs /usr/local/bin
    /bin/bash ../libtool –mode=install /usr/bin/install -c dictconv /usr/local/bin/dictconv
    /usr/bin/install -c dictconv /usr/local/bin/dictconv
    /usr/bin/install: cannot create regular file `/usr/local/bin/dictconv’: Permission denied
    make[2]: *** [install-binPROGRAMS] Error 1
    make[2]: Leaving directory `/home/atcold/Desktop/Dizionario/dictconv-0.2/src’
    make[1]: *** [install-am] Error 2
    make[1]: Leaving directory `/home/atcold/Desktop/Dizionario/dictconv-0.2/src’
    make: *** [install-recursive] Error 1″
    Ordunque, che si fa?

    Grazie

  16. Atcold Says:

    Ok, provo sudo (forse sto cominciando a capire). Ti faccio sapere

  17. Atcold Says:

    Bene: ti adoro! Funzia tutto ottimamente, ma cos’e’ che mi hai fatto fare?
    Gia’ che ci siamo, giusto per strafare un pochettino, mi sono letto il tutorial di “Egregorion”… e mi e’ venuta voglia di provare ad eliminare le scritte del tipo $#######$… provo ad installare il “stardict-tools-2.4.8.tar.bz2″, ma questo mi esce con una frase del tipo “atcold@atcold-laptop:~/Desktop/Dizionario/stardict-tools-2.4.8$ ./configure
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for gawk… no
    checking for mawk… mawk
    checking whether make sets $(MAKE)… yes
    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking for style of include used by make… GNU
    checking for gcc… gcc
    checking for C compiler default output file name… a.out
    checking whether the C compiler works… yes
    checking whether we are cross compiling… no
    checking for suffix of executables…
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ANSI C… none needed
    checking dependency style of gcc… gcc3
    checking for a sed that does not truncate output… /bin/sed
    checking for egrep… grep -E
    checking for ld used by gcc… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking for /usr/bin/ld option to reload object files… -r
    checking for BSD-compatible nm… /usr/bin/nm -B
    checking whether ln -s works… yes
    checking how to recognise dependent libraries… pass_all
    checking how to run the C preprocessor… gcc -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking dlfcn.h usability… yes
    checking dlfcn.h presence… yes
    checking for dlfcn.h… yes
    checking for g++… g++
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking dependency style of g++… gcc3
    checking how to run the C++ preprocessor… g++ -E
    checking for g77… no
    checking for f77… no
    checking for xlf… no
    checking for frt… no
    checking for pgf77… no
    checking for fort77… no
    checking for fl32… no
    checking for af77… no
    checking for f90… no
    checking for xlf90… no
    checking for pgf90… no
    checking for epcf90… no
    checking for f95… no
    checking for fort… no
    checking for xlf95… no
    checking for ifc… no
    checking for efc… no
    checking for pgf95… no
    checking for lf95… no
    checking for gfortran… no
    checking whether we are using the GNU Fortran 77 compiler… no
    checking whether accepts -g… no
    checking the maximum length of command line arguments… 32768
    checking command to parse /usr/bin/nm -B output from gcc object… ok
    checking for objdir… .libs
    checking for ar… ar
    checking for ranlib… ranlib
    checking for strip… strip
    checking if gcc supports -fno-rtti -fno-exceptions… no
    checking for gcc option to produce PIC… -fPIC
    checking if gcc PIC flag -fPIC works… yes
    checking if gcc static flag -static works… yes
    checking if gcc supports -c -o file.o… yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries… yes
    checking whether -lc should be explicitly linked in… no
    checking dynamic linker characteristics… cat: /etc/ld.so.conf.d/*.conf: No such file or directory
    GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    checking whether stripping libraries is possible… yes
    checking if libtool supports shared libraries… yes
    checking whether to build shared libraries… yes
    checking whether to build static libraries… yes
    configure: creating libtool
    appending configuration tag “CXX” to libtool
    checking for ld used by g++… /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld… yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking for g++ option to produce PIC… -fPIC
    checking if g++ PIC flag -fPIC works… yes
    checking if g++ static flag -static works… yes
    checking if g++ supports -c -o file.o… yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries… yes
    checking dynamic linker characteristics… cat: /etc/ld.so.conf.d/*.conf: No such file or directory
    GNU/Linux ld.so
    checking how to hardcode library paths into programs… immediate
    appending configuration tag “F77″ to libtool
    checking for gcc… (cached) gcc
    checking whether we are using the GNU C compiler… (cached) yes
    checking whether gcc accepts -g… (cached) yes
    checking for gcc option to accept ANSI C… (cached) none needed
    checking dependency style of gcc… (cached) gcc3
    checking whether we are using the GNU C++ compiler… (cached) yes
    checking whether g++ accepts -g… (cached) yes
    checking dependency style of g++… (cached) gcc3
    checking for ANSI C header files… (cached) yes
    checking for stdlib.h… (cached) yes
    checking for pkg-config… /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0… yes
    checking for STARDICT… configure: error: Package requirements (gtk+-2.0 >= 2.6) were not met:

    No package ‘gtk+-2.0′ found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables STARDICT_CFLAGS
    and STARDICT_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.”
    Come prima vado su adept, scarico la libreria e… non funziona alcunche’, come al solito.
    Se non ti sei ancora stufato di me, ed i miei problemi, ti pregherei di rispondermi.. altrimenti ti capirei e ti lascerei in pace, in quanto mi hai gia’ fatto funzionare ottimamente il dizionario.

    Atcold

  18. Mattneri Says:

    Utilizza apt-get. Se non sbaglio i repository di ubuntu dovrebbero contenere anche il pacchetto stardict-tools.
    Dai una occhiata se c’e’ digitando
    apt-cache search stardict
    se c’e’
    apt-get install stardict-tools (o come si chiama il pacchetto)

  19. Marco Says:

    vorrei utilizzare dictconv per convertire i dizionari di babylon per stardict, ma quando apro il file che ho scaricato per aprire dictconv mi chiede il nome del programma con il quale lo voglio aprire, nn capisco come fare a convertire i miei dizionari mi puoi dare un aiuto?? grazie!!!!

  20. Mattneri Says:

    Il file e’ un package per ubuntu. Se usi un altra distribuzione devi scaricarti il sorgente e ricompilartelo ( se ti interessa mandami una mail a mlovato (at) gmail (dot) com ).
    Se invece usi windows dovrai aspettare ancora un po’

  21. sarasam Says:

    Ciao
    volevo chiederti, non essendo esperto in ubuntu ,se l’installazione su Gutsy e’ funzionante in quanto ricevo il seguente
    risultato:
    andrea@andrea-desktop:~/dictconv-0.2.1$ sudo make all install
    make all-recursive
    make[1]: Entering directory `/home/andrea/dictconv-0.2.1′
    Making all in src
    make[2]: Entering directory `/home/andrea/dictconv-0.2.1/src’
    source=’dictconv.cpp’ object=’dictconv.o’ libtool=no \
    depfile=’.deps/dictconv.Po’ tmpdepfile=’.deps/dictconv.TPo’ \
    depmode=gcc3 /bin/bash ../depcomp \
    i486-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/libxml2 -g -O2 -c -o dictconv.o `test -f ‘dictconv.cpp’ || echo ‘./’`dictconv.cpp
    In file included from babylonreader.h:25,
    from dictconv.cpp:21:
    babylon.h:25:18: error: zlib.h: Nessun file o directory
    In file included from dictconv.cpp:23:
    freedictreader.h:29:30: error: libxml/xmlmemory.h: Nessun file o directory
    freedictreader.h:30:27: error: libxml/parser.h: Nessun file o directory
    babylon.h:179: error: ‘gzFile’ does not name a type
    freedictreader.h:44: error: ‘xmlDocPtr’ has not been declared
    freedictreader.h:44: error: ‘xmlNodePtr’ has not been declared
    freedictreader.h:45: error: ‘xmlNodePtr’ does not name a type
    freedictreader.h:46: error: ‘xmlNodePtr’ does not name a type
    freedictreader.h:47: error: ‘xmlNodePtr’ does not name a type
    make[2]: *** [dictconv.o] Error 1
    make[2]: Leaving directory `/home/andrea/dictconv-0.2.1/src’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/andrea/dictconv-0.2.1′
    make: *** [all] Error 2
    andrea@andrea-desktop:~/dictconv-0.2.1$
    Grazie

  22. Mattneri Says:

    C’e’ un motivo particolare perche’ la cerchi di installare dai sorgenti?

    Te lo chiedo perche’ se non hai esigenze particolari meglio se ti scarichi il deb e lo installi tramite dpkg
    dpkg -i nome_pacchetto.deb

    Questo perche’ ti risolve in automatico anche tutte le dipendenze

  23. sarasam Says:

    Mattneri scusami!!!!
    non avevo visto il link al deb !
    Funziona . Tutto OK.
    I . bgl li converte tutti ma tu sai se si possa fare con i .bgc
    grazie ancora e buona serata.
    Andrea - Bolzano-

  24. Traduttore lingue per ubuntu « Servizieinformatica Says:

    […] di riferimento http://www.egregorion.net mattneri.altervista.org Altro articolo mattneri.altervista.org naturalmente Stardict Qualora il primo dictconv fatto da mattneri non dovesse essere più […]

  25. Alessandro Says:

    Mai provato Lingoes? Come Babylon ma gratuito: http://www.lingoes.net/
    Ciao a tutti! ;-)

  26. Mattneri Says:

    Ho dato una occhiata a Lingoes, ma da quanto ho visto le versioni scaricabili sono solamente per windows. Quindi continuo a preferire Stardict come alternativa a babylon

  27. stephanazs Says:

    Interesting facts.I have bookmarked this site. stephanazs

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.