Open linguistbro opened 2 months ago
Can you copy & paste some of the source values that you tried, if they're not confidential? Some characters appear the same but they actually use different unicode values. The Hanja coverage of this library is not complete so I'd suspect the source_value
is a such case.
The source code is confidential unfortunately but I can share the simplified version. I even used this example "大韓民國은 民主共和國이다." that is on the homepage when testing my app.
source_value is a pandas dataframe string. My dataframe only has 2 columns and rows (for testing purposes).
The test code is like this:
for index, row in dataframe.iterrows():
source_value = row['Source']
converted_source = hanja.translate(source_value, 'substitution')
return converted_source
I used some debugging with the code to find out where it stops because it does not throw any errors.
I updated the code to be like this. I am using PyQt6:
for index, row in dataframe.iterrows():
error_label.setText('Working - 1')
source_value = row['Source']
error_label.setText('Working - 2')
converted_source = hanja.translate(source_value, 'substitution')
error_label.setText('Working - 3')
return converted_source
The label never changes to 'Working - 3'. The app does not freeze or crash, any other function on the app continues to work fine (it is a multi function tool). However, if I compile again with pyinstaller using '--collect-all hanja', everything is fine! If I run the code from the IDE, it is also fine.
I know it sounds super odd but this is what I experience if I don't use '--collect-all hanja' with pyinstaller.
I will try to replicate this issue with a small dummy code at home using my personal PC. If I can replicate the issue again, I will share the dummy code and a video. I cannot share any part of the app I am working on at work, sorry.
Hello! Unfortunately, I am not an advanced python coder so I'm not sure if I can provide the best feedback but here is what I encountered.
pyinstaller -F -w main.py
--hidden-import
, it does not work. Then, I try--collect-all
and it works.This is the only bit of hanja I use in my code:
converted_source = hanja.translate(source_value, 'substitution')
I do not know what info/files/logs to share with you to provide more information, please let me know if you want more specific details. It might be a rare issue, I might be the only person encountering this type of problem.
Edit: I'm using python 3.11 and a venv. Also, I am able to reproduce this problem 100% of the time.