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

Migrate to Python3 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Migrate to Python3 #1

wants to merge 2 commits into from

Conversation

rroessler1
Copy link

I had to upgrade this to support python3 for my project, so thought I'd create a pull request in case anyone else needs it. It was a somewhat nontrivial change, due to the differences in default string encoding between python2 and python3.

I'm a python beginner and literally my first time using Python C Extensions, so there's likely some stuff I missed or at least something that could be better.
Maybe want to merge this into a separate branch so users can choose between python2 or 3?

Testing: the test.py works.

*Code will compile for both python2 and python3.
*Code only runs on python2.
*This contains the breaking changes required to port to python3.
 They are primarily related to differences in how strings are
 stored and handled.
*Also updated test.py for python3 syntax.
@aehlke
Copy link
Owner

aehlke commented May 5, 2020

Thanks. I no longer use this... Curious what you're using it for? Glad others have found it to be of use :)

@rroessler1
Copy link
Author

No it didn't look like it was being used :) but just in case someone else comes across it...

I'm using it to get word definitions from a Japanese dictionary file. The project is to automatically generate user-specific flashcards for new vocabulary words to help people learn languages.

If you're curious, the site I'm developing is here: https://languagelearningflashcards.com/
Though I can't use the JP EPWING dictionary (licensing issues) on the site, but I use it for personal use and studying.

@CalculusAce
Copy link

CalculusAce commented Sep 13, 2020

@rroessler1 Firstly, thank you so much for sharing your python3 update for this project. I had a few questions about the setup for this module and if there are any opportunities to expand this project moving forward. I was planning to post these comments in issues under your fork but noticed the issues tab wasn't enabled on it.

I looked through the code in setup.py and noticed a few paths for include directories under the Windows option that I am a little confused about. I wasn't sure if the EBLibrary path and a Python26 path are actually required paths for the include directories or if they are fragments from the old implementation of the code that can be erased in favor of just having the src directory? In the event they are required paths, is there something else that needs to be setup that will create those directories with the necessary files inside of them?

Along the same lines as that question, I wanted to see if you may be able to briefly outline the setup process for getting this module running on the windows side, to ensure that I am understanding the steps correctly. I am not very familiar with C, so I wasn't sure at what point the C code needs to be compiled or if anything is needed from the links provided in the readMe, as they seem quite dated. It would be really helpful to understand if the test.py code is what is used on the command line followed by the options and words to be looked up as well when actually using the code.

Lastly, I was curious if it is possible to modify this code to function as more of an extraction tool to remove all of the data from an epwing and reformat it? There are a handful of epwings that have been extracted into a much more convenient json format, that is compatible with projects like Yomichan, but there are a lot of them that are still trapped in the epwing format. I looked through the code and it appears that this is only currently setup to extract the definitions of individual words (not sure if you can enter in multiple words or wild card characters * on the command line when running this), but I wanted to get your thoughts on this as I think it would be really useful to be able to leverage this project to potentially extract that data out of the epwings and put it into the json format for use in Yomichan.

Thanks!

@rroessler1
Copy link
Author

@CalculusAce is this still something you're interested in? I haven't worked on this in months but I have some free time now and potentially could. Though I don't have a Windows setup so I'm not sure how much I can help with that.

Also I enabled "Issues" on my fork so we can move comments over there :)

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

Successfully merging this pull request may close these issues.

3 participants