9

How to convert stardict dictionary file format to any readable format (xml, txt or something)?

3 Answers 3

3

The stardict-tools tarball downloadable from their website has a stardict2txt tool that you'll need to build from source.

2
  • It's almost impossible to compile though. I tried on FreeBSD, OS X, and finally Ubuntu. After numerous fixes to the code, I got it to compile but it segfaults when you run it.
    – Gazzer
    Sep 2, 2010 at 4:29
  • You can now install the tools by sudo apt-get install stardict-tools in Ubuntu. The tools are at /usr/lib/stardict-tools/
    – Raptor
    Nov 14, 2016 at 4:00
2

I found this step by step guide on how to use the StarDict editor for Windows in order to decompile a StarDict dictionary to XML format.

  • Extract all files to a folder and then launch the file stardict-editor.exe, switch to the tab DeCompile.
  • Now look at the dictionary files of StarDict you got, there should be 3 files : *.idx, *.ifo, *.dz.
  • Rename the *.dz file to *.gz. Use WinZip or WinRAR to extract the *.dict file inside.
  • Rename all the *.dict, *.ifo, *.idx files to a same name.
  • Back to the StarDict Editor program, click Browse and select the *.ifo file and hit Decompile.
  • You will see a new *.txt file inside the folder.
  • Use it with DfM DictionaryGeneration.
2

Your can use this:

https://github.com/ilius/pyglossary

If your need install it for user on linux your can create virtualenv and acrivate it

  git clone https://github.com/ilius/pyglossary.git
  cd pyglossary
  #1. Add to setup.py after:
  #import logging
  #next line:
  #logging.basicConfig()
  #
  #1. change in setup.py 
  #from pyglossary.glossary import VERSION to
  #VERSION = "3.1.0" # version that was tested in my case
  python setup.py
  pyglossary

And converter will be running, that your can doing different conversions.

Other way:

There is file .dict.dz.

  1. Emacs open it as text file, then you can copy text and place it to some file.
  2. execute:

    dictunzip <dictname>.dict.dz

To convert it to .dict file, and read as text file. Program dictunzip is in package dictzip (debian, ubuntu). In my case .dict was readable, may be in some cases it is binary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.