Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StarDict to txt error #19

Closed
niosus opened this issue Oct 24, 2015 · 2 comments
Closed

StarDict to txt error #19

niosus opened this issue Oct 24, 2015 · 2 comments
Labels

Comments

@niosus
Copy link

niosus commented Oct 24, 2015

First of all - your program is a life saver!

However, I have bumped in an issue and before I dig into the code I wanted to ask you (or whoever sees this). Maybe you have encountered smth like it and know how to deal with it.

tldr: I load a stardict file (*.ifo) and it loads fine, when I try to write it to text I get errors.

Longer version:

See screenshot:
screenshot from 2015-10-24 23 49 12

I load the stardict dictionary (can be found here) and it seems to load fine. Output in terminal:

Reading from StarDict (ifo), please wait...
reading Stardict file: "/home/igor/Downloads/stardict-freedict-deu-eng-2.4.2/dictd_www.freedict.de_deu-eng.ifo" done.
81628 words found.
/home/igor/External/pyglossary/ui/ui_gtk.py:1285: DeprecationWarning: 
  self.progressbar.update(rat)
time left = 3.134076 seconds
version="2.4.2"
wordcount="81628"
idxfilesize="1730874"
bookname="German - English"
description="Made by Hu Zheng"
date="2007.8.29"
sametypesequence="m"

When I try to convert it to text I get the following error:

Converting to Tabfile (txt, dic), please wait...
filename=/home/igor/Downloads/stardict-freedict-deu-eng-2.4.2/dictd_www.freedict.de_deu-eng.txt
Traceback (most recent call last):
  File "/home/igor/External/pyglossary/ui/ui_gtk.py", line 406, in convert_clicked
    self.glos.write(oPath, format=format)
  File "/home/igor/External/pyglossary/pyglossary/glossary.py", line 372, in write
    getattr(self, 'write%s'%format).__call__(filename, **options)
  File "/home/igor/External/pyglossary/pyglossary/plugins/tabfile.py", line 72, in write
    ext='.txt',
  File "/home/igor/External/pyglossary/pyglossary/glossary.py", line 421, in writeTxt
    alts = item[2]['alts']
KeyError: 'alts'

Any ideas?

@tuxor1337
Copy link

That's easy, I'm wondering how this never occurred to anyone else before.

@niosus
Copy link
Author

niosus commented Oct 25, 2015

@tuxor1337 👍 ahahaha, well that's an easy fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants