![]() |
#166 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ?
|
![]() |
![]() |
![]() |
#167 | |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Quote:
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. Last edited by oren64; 11-27-2015 at 05:52 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#168 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#169 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#170 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
Advert | |
|
![]() |
#171 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#172 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#173 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 EDIT: i put the file in penelope-master folder and run, but there not dicthtml.zip when it finish. Last edited by oren64; 11-27-2015 at 02:51 PM. |
![]() |
![]() |
![]() |
#174 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#175 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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... Last edited by oren64; 11-27-2015 at 03:38 PM. |
![]() |
![]() |
![]() |
#176 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#177 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
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. |
![]() |
![]() |
![]() |
#178 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#179 | |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Nov 2015
Device: Kobo Aura H2O
|
Quote:
UPD: I send it. Thank you! ![]() Last edited by Simpetus; 11-28-2015 at 12:56 AM. |
|
![]() |
![]() |
![]() |
#180 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
Tags |
kobo dictionaries |
|
![]() |
||||
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 |