Giter Site home page Giter Site logo

olety / epwing2kindle Goto Github PK

View Code? Open in Web Editor NEW
73.0 7.0 3.0 3.44 MB

Converting EPWING dictionaries into something you can actually use (mobi)

License: GNU General Public License v3.0

Python 100.00%
japanese pitch-accent kindle dictionary-conversion dictionary-tools japanese-language epwing-dictionary epwing mobi kindlegen

epwing2kindle's Introduction

Hi there πŸ‘‹

epwing2kindle's People

Contributors

olety avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

epwing2kindle's Issues

UnicodeEncodeError when converting to opf

The Tab to Opf conversion step does not create a file when running the standard tool, and the japanese-specific tool gives a UnicodeEncodeError.

Standard Tool

Reading keys: 534710keys [00:04, 125764.89keys/s]
Writing html: 43files [00:04,  8.96files/s]
Writing opf:

Japanese-Specific

Reading keys
Writing keys
Traceback (most recent call last):
  File "D:\grant\Downloads\epwing2kindle-master\tab2opf-master\tab2opf.py", line 329, in <module>
    ndicts = writekeys(defns, name)
  File "D:\grant\Downloads\epwing2kindle-master\tab2opf-master\tab2opf.py", line 252, in writekeys
    writekey(to, key, defns[key])
  File "D:\grant\Downloads\epwing2kindle-master\tab2opf-master\tab2opf.py", line 229, in writekey
    to.write('; '.join(ndefn for _, ndefn, _ in g))
  File "C:\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 2-9: character maps to <undefined>

I looked into the closed issue that covered a similar problem, but it didn't seem to be applicable to this one. I tried with a different dictionary and it gave me a unicode error as well.

Tried json->tab of an already made json but got this error and a 0 bytes .tab file

As per said in the title, I tried running yomi2tab.py on an already created json (specifically a korean-japanese one) and got this, on Linux 20.03:

$ python3 yomi2tab.py -o ko-jadict.tab yomi_output/
Processing files: 0%| | 0/1 [00:00<?, ?file/s]/home/musrar/Documents/korean dict/epwing2kindle-master/yomi2tab.py:90: FutureWarning: Series.getitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use ser.iloc[pos]
if '―' in row[0]:
Processing files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [03:48<00:00, 228.24s/file]
Traceback (most recent call last):
File "/home/musrar/Documents/korean dict/epwing2kindle-master/yomi2tab.py", line 229, in
result = process_folder(args.folder, simplify=args.simplify)
File "/home/musrar/Documents/korean dict/epwing2kindle-master/yomi2tab.py", line 169, in process_folder
result.replace('', pd.np.nan, inplace=True)
AttributeError: module 'pandas' has no attribute 'np'

The result was a 0 bytes "koja-dict.tab"
I could provied the .json file if needed be.

yomi2tab problem

Describe the bug
I wanted to convert my existing jmdict_german dictionary to a Kindle compatible file. But I just get syntax errors. IDK why this is happening. Additional, even if it would work, I wasn't really able to find a kindlegen setup or which version I need at least and Amazon doesn't offer it as a download any more.

To ReproduceD
Steps to reproduce the behavior:

  1. Run py -3.11.2 yomi2tab.py -o mydict.tab "C:\Users\jbble\AppData\Local\Programs\Python\Python311\yomi_output" on python
  2. See error.

Expected behavior
I thought it would convert my JSON files into Tab files so that I can forward with the whole process.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Python version 3.11.2

Additional context
/

Better support for verb inflections

Currently inflection recognition seems pretty random, some times it actually founds the verb but a lot of the time it just display a noun.

For instance:
When looking for 向けて it shows the definitions of "向け" where it should be displaying "向ける"
When looking for ζ₯た it shows the definitions of "ζ₯" where it should be displaying "ζ₯γ‚‹"
but
When looking for 飲まγͺγ‹γ£γŸ it correctly displays ι£²γ‚€

jdmict-kindle seems to have much better inflection recognition so perhaps it may be worth a look?
https://github.com/jrfonseca/jmdict-kindle

error when trying to convert.

Processing files: 0%| | 0/30 [00:00<?, ?file/s] Traceback (most recent call last): File "yomi2tab.py", line 229, in <module> result = process_folder(args.folder, simplify=args.simplify) File "yomi2tab.py", line 127, in process_folder 'unknown3', 'def', 'id', 'unknown4'] File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 3094, in __setattr__ return object.__setattr__(self, name, value) File "pandas/_libs/src/properties.pyx", line 65, in pandas._libs.lib.AxisProperty.__set__ (pandas/_libs/lib.c:45255) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 473, in _set_axis self._data.set_axis(axis, labels) File "/home/ubuntu/.local/lib/python3.6/site-packages/pandas/core/internals.py", line 2836, in set_axis (old_len, new_len)) ValueError: Length mismatch: Expected axis has 3 elements, new values have 8 elements

Hello!

I am trying to convert some dictionaries from: yomichan and i got the error above.

I skipped the yomichan-import phase since the dictionaries there are already in json format. So i just unzip and then use the command:
python3 yomi2tab.py -o innocent_corpus.tab yomi_output/

The dictionaries i want to convert are innocent_corpus.zip, kanjidic_english.zip, kireicake.zip.

Is it because the dictionaries on yomichan are not compatible with the script, or is something wrong with my python installation?

Thank you!

"[Errno 2] No such file or directory" when attempting to convert JSON to Tab

Describe the bug
In the 3rd step, converting the JSON to Tab, python on my computer doesn't seem to be able to recognise yomi2tab.py and gives me the error in the screenshot. I have yomi2tab.py in my working folder. Should I try to use 3.6 instead? I might be messing up something really obvious, I've never used Python before

Screenshots
default

PS:
For clarification; I used "py -3.7" in the screenshot above but it returns the same error if i write "py -3" and if i use a different directory on a different disc

Trouble installing requirements

Hi! I am Xavier22 from the koohii thread, thanks so much for making this. I am not sure if it's okay to post technical support questions in the issues section, but I was trying to install the requirements and was not able to. I just got this screen here:

image

Do you have any idea what I might be doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.