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

Can not open texts of Japanese #94

Closed
99MengXin opened this issue Feb 20, 2023 · 5 comments
Closed

Can not open texts of Japanese #94

99MengXin opened this issue Feb 20, 2023 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@99MengXin
Copy link

99MengXin commented Feb 20, 2023

Describe the bug
Can not open texts of Japanese.

To Reproduce
Steps to reproduce the behavior:

  1. Use master branch
git clone https://github.com/HugoFara/lwt.git
cd lwt
docker compose up -d
  1. Wait for a minute for db building
  2. Go to Languages
  3. Go to New Language
  4. Click on Language Settings Wizard
  5. Click on My native language is: Chinese (Traditional) and I want to study: Japanese
  6. Click on Set Language Settings
  7. Click on Save
  8. Go to Texts
  9. Go to New Text ...
  10. Click on Language and choose Japanese
  11. Click on Title and paste N5レベル
  12. Click on Text and paste 今日、図書館に行きました。
  13. Click on Save and Open
  14. See error

Expected behavior
Open the text normally.

Screenshots
截圖 2023-02-20 14 20 30

Desktop (please complete the following information):

  • OS: MacOS
  • Safari 16.2

Smartphone (please complete the following information):

  • iPhone 8
  • iOS8.1 14.8
  • Safari
  • 14

Additional context
Both selections (Regular Expressions and MeCab) of RegExp Word Characters have been tested but fail.

@HugoFara
Copy link
Owner

Hi!

The issue with MeCab parser says it all: MeCab is not detected, you need to install it separately. Don't forget to install it inside your Docker container 😉

You should be able to use LWT for Japanese only with regular expressions with the results are not so good. What is the error message?

Hope that helps you!

@99MengXin
Copy link
Author

99MengXin commented Feb 20, 2023

Hi, thanks for your swift reply.

I re-bulit container again without MeCab. It was the same error when I chose regular expressions but MeCab.

截圖 2023-02-20 21 20 44

Now the texts of Japanese with MeCab and regular expressions works after installation. 🙂

Could one installation solve two problems?

@99MengXin
Copy link
Author

99MengXin commented Feb 20, 2023

I found 2 ways for docker users to install MeCab from here.

  1. Input 2 commands via Terminal, and change lwt if you named your container with other name.
docker exec -it lwt bash
apt-get update && apt-get install -y mecab libmecab-dev mecab-ipadic-utf8
  1. Amended Dockerfile, copy and paste below command at Line No. 8 of Dockerfile.
RUN apt-get update && apt-get install -y mecab libmecab-dev mecab-ipadic-utf8

@HugoFara HugoFara added the documentation Improvements or additions to documentation label Feb 20, 2023
@HugoFara
Copy link
Owner

Thanks for your suggestion! I will add it to the documentation!

@HugoFara
Copy link
Owner

It was the same error when I chose regular expressions but MeCab

By the way, I noticed another error: the RegExp should alternate between mecab and \x{4E00}-\x{9FFF}\x{F900}-\x{FAFF}\x{3040}-\x{30FF}\x{31F0}-\x{31FF} but I think it wasn't, hence your problem. I pushed a fix right now.

HugoFara added a commit that referenced this issue Feb 22, 2023
Integrating recommendation of #85 and #94.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants