Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 11-27-2015, 04:59 AM   #166
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
@ oren64 : did you manage to install lxml / penelope 3.0 ?
AlPe is offline   Reply With Quote
Old 11-27-2015, 05:48 AM   #167
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Quote:
Originally Posted by AlPe View Post
EDIT: I did not read the screenshots carefully enough. It looks you have the compiler installed, but compiling lxml fails for some reason.

http://stackoverflow.com/questions/3...scrapy-install
I don't understand how to do it.

I copy the file "lxml-3.5.0-cp35-none-win_amd64.whl" to the folder and run pip "pip install lxml-3.5.0-cp35-none-win_amd64.whl" but it didn't work.
it say "lxml-3.5.0-cp35...not supported wheel on this platform".


I download libxml2 but i don't understand what to do whit it.
Attached Files
File Type: zip libxml2-2.7.8.win32.zip (2.61 MB, 339 views)

Last edited by oren64; 11-27-2015 at 05:52 AM.
oren64 is offline   Reply With Quote
Advert
Old 11-27-2015, 07:23 AM   #168
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Note that the wheel files are compiled for a specific version of Python and a specific 32/64 bit architecture.

lxml-3.5.0-cp35-none-win_amd64.whl => cp35 = Python 3.5, win = Windows, amd64 = 64 bit (AMD or Intel)

Be sure you download the one matching your Python version. Maybe setting this will help (not sure, I do not use Windows):

> set STATICBUILD=true
> pip install lxml*.whl

=== === ===

Otherwise, install by source and forget about XML. If you have MARISA executables already compiled, you can avoid pip install marisa-trie. You can just specify their path each time you need to execute Penelope, by passing the --marisa-bin-path=C:\path\to\marisa\bin

Last edited by AlPe; 11-27-2015 at 07:25 AM.
AlPe is offline   Reply With Quote
Old 11-27-2015, 08:07 AM   #169
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
Okay I install xml and penelope, the files are in c:\python27\lib\site-packages\penelope,marisa_trie-0.7.2.dist-info,penelope-3.0.1.11.dist-info.
but how do I open manual?

Last edited by oren64; 11-27-2015 at 08:19 AM.
oren64 is offline   Reply With Quote
Old 11-27-2015, 08:16 AM   #170
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
If you installed via pip, you should have the "penelope" script available system-wise, try:

> penelope

or, if the above does not work:

> python -m penelope
AlPe is offline   Reply With Quote
Advert
Old 11-27-2015, 08:44 AM   #171
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
I the 3 options: penelope, -m penelope, python -m penelope, get Error 2.
Attached Thumbnails
Click image for larger version

Name:	3.PNG
Views:	460
Size:	285.9 KB
ID:	144104  
oren64 is offline   Reply With Quote
Old 11-27-2015, 09:12 AM   #172
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
From your screenshot, your first command has a "cd" in front, and the other has spurious " characters.

To confirm penelope is installed correcty:

1. open a python interpreter command:

PROMPT> python

(or python.exe, I do not remember which one is exported to $PATH)

2. import penelope:

PYTHONPROMPT> import penelope

If no error is raised, then penelope is installed correctly.

3. exit:

PYTHONPROMPT> exit()

=== === ===

To run penelope: try issuing:
PROMPT> penelope
or
PROMPT> python -m penelope
or
PROMPT> python.exe -m penelope
AlPe is offline   Reply With Quote
Old 11-27-2015, 11:25 AM   #173
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
What you write didn't work i get an ERROR.

But i find the script "penelope" and run it with pip "c:\python27\script\penelope".

I try to test it but i don't know where to put the dict.zip.
run with pip
Code:
"c:\python27\script\penelope" -i dict.zip -j stardict -f he -t he -p kobo -o dicthtml-en-he.zip
what file need to be in "dict.zip" name.dz or name.dict?


EDIT: i put the file in penelope-master folder and run, but there not dicthtml.zip when it finish.
Attached Thumbnails
Click image for larger version

Name:	3.PNG
Views:	468
Size:	36.1 KB
ID:	144123   Click image for larger version

Name:	5.PNG
Views:	428
Size:	42.4 KB
ID:	144124  

Last edited by oren64; 11-27-2015 at 02:51 PM.
oren64 is offline   Reply With Quote
Old 11-27-2015, 12:55 PM   #174
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
You only use "pip" when installing Python packages, not to run Python scripts/programs.

Indeed, the Penelope script gets executed when you run the Python interpreter (python.exe).

=== === ===

The -i flag accepts a path, either relative (like "dict.zip", which means "read the file dict.zip in the current directory") or absolute (like "C:\foo\dict.zip", which means "read the file dict.zip in the directory "foo" in drive "C:").

In the first screenshot Penelope was complaining that it cannot find "dict.zip" in the current directory. That's why the error went away when you copied the file in that directory.

=== === ===

About your problem: from the output, it looks like everything went OK, hence it is strange that the file was not created. (?)

Instead of "-o dicthtml-he.zip", try using an absolute path: "-o C:\dicthtml-he.zip", and see if it solves the issue. You might want to add the "-d" flag to output debug messages too.
AlPe is offline   Reply With Quote
Old 11-27-2015, 01:12 PM   #175
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
"-o C:\dicthtml-he.zip" get ERROR 2


EDIT: I find it in c:\...\local\temp\tmpisfcz,tmptmphjhfry,tmp...
Attached Thumbnails
Click image for larger version

Name:	7.PNG
Views:	479
Size:	110.5 KB
ID:	144132   Click image for larger version

Name:	8.PNG
Views:	394
Size:	66.2 KB
ID:	144133  

Last edited by oren64; 11-27-2015 at 03:38 PM.
oren64 is offline   Reply With Quote
Old 11-27-2015, 02:10 PM   #176
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
OK, it seems that the Kobo file is generated correctly in the temporary directory, but eventually it is not copied to the destination specified by the user.

This is clearly a bug, I will borrow a Windows machine and see what is going wrong to fix it.

For the moment, as a workaround just use the -d and -k flags, so that you will know the path of the temporary directory and you can copy the file from there.
AlPe is offline   Reply With Quote
Old 11-27-2015, 04:04 PM   #177
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by oren64 View Post
"-o C:\dicthtml-he.zip" get ERROR 2


EDIT: I find it in c:\...\local\temp\tmpisfcz,tmptmphjhfry,tmp...
Try setting a different output path like "C:\mykobodics\dicthtml-he.zip" (and create the directory yourself for good measure). There might be a problem with writing permission to the root, even though nothing on your screenshot seems to hint at this.

Last edited by tshering; 11-27-2015 at 04:07 PM.
tshering is offline   Reply With Quote
Old 11-27-2015, 05:10 PM   #178
oren64
I need a chapter break
oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.oren64 ought to be getting tired of karma fortunes by now.
 
oren64's Avatar
 
Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
When i change the name to "-o C:\...\dicthtml-he.zip" python try to open dicthtml-he.zip as file, an get error "python can't open file 'dicthtml-he.zip'".

Last edited by oren64; 11-27-2015 at 05:26 PM.
oren64 is offline   Reply With Quote
Old 11-27-2015, 10:34 PM   #179
Simpetus
Enthusiast
Simpetus began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Nov 2015
Device: Kobo Aura H2O
Quote:
Originally Posted by AlPe View Post
EDIT: can you send me just the "words" file of your full dictionary by email (or send me a link to it by email)? I will use it to test that the new option produces working dictionaries. Just the "words" file, I do not need the definitions. My email is here: http://www.albertopettarin.it/contact.html
Sure thing. I will do it an a bit.

UPD: I send it. Thank you!

Last edited by Simpetus; 11-28-2015 at 12:56 AM.
Simpetus is offline   Reply With Quote
Old 11-29-2015, 07:26 AM   #180
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
@oren64: I found and (hopefully) fixed the problem with outputting to a relative path, I pushed a new version on GitHub and PyPI, v3.1.0. You can upgrade penelope with:

> pip install penelope --upgrade

@Simpetus: using k=2 prefix length on your dictionary produced more than 64k prefixes, and that caused an error producing the ZIP file: only the first 64k prefix .html files were actually put in the ZIP file, and that should explain why the dictionary did not work on your Kobo.

As discussed above, in Penelope v3.1.0 I added the flag:

--group-by-prefix-length

This allows you to set the length of the prefix to be used when grouping headwords into the .html files. The default value is 2 (equivalent to the behavior of Penelope v3.0.1 and earlier).

In your case, setting it to 1 ( --group-by-prefix-length=1 ), it will produce ~24k prefixes; the resulting ZIP is valid, but yet I do not know if the Kobo is able to handle it.

=== === ===

As I discussed above, one workaround consists in merging the "raw" groups (but I do not know if the Kobo software can handle it). To do so, you can use the following flags:

--group-by-prefix-merge-min-size

Sets the minimum number of headwords that each .html file must contain. Setting it to, say, 1000, will merge prefix .html until at least 1000 headwords are included. Then it starts a new .html, and so on. (a, b, c, ... z => a (a+b+c), d (d+e+f+g), etc...)

--group-by-prefix-merge-across-first

When specified, this flag instructs Penelope to merge groups even if the first character is different. In your case, specify it. (The flag is also used when outputting EPUB or MOBI, and in that case user might want to PREVENT merging headwords with different initial letter. That's why the default value for the setting is False, and you need to explicitly specify the above flag to set it to True.)

To recap, you might want to try generating a dictionary with Penelope v3.1.0 with:

1. --group-by-prefix-length=1

If the resulting dictionary works on your Kobo, you are good. Otherwise, try:

2. --group-by-prefix-length=1 --group-by-prefix-merge-min-size=1000 --group-by-prefix-merge-across-first

And again see if that works on your Kobo.
AlPe is offline   Reply With Quote
Reply

Tags
kobo dictionaries


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New custom English dictionaries ShellShock Kobo Developer's Corner 166 09-22-2020 02:48 PM
Kobo desktop loading dictionaries brudigia Kobo Reader 1 07-16-2014 12:55 PM
Touch building custom dictionaries, especially Japanese-English tshering Kobo Reader 0 07-12-2012 06:00 PM
Custom dictionaries for 350/650? 1drey Sony Reader 5 12-28-2010 12:49 PM
non-English dictionaries in eReader on iPod Touch? ficbot Reading and Management 1 10-11-2008 09:04 AM


All times are GMT -4. The time now is 01:54 AM.


MobileRead.com is a privately owned, operated and funded community.