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

Investigate switch to difflib #2305

Closed
dae opened this issue Jan 9, 2023 · 8 comments
Closed

Investigate switch to difflib #2305

dae opened this issue Jan 9, 2023 · 8 comments
Milestone

Comments

@dae
Copy link
Member

dae commented Jan 9, 2023

1e0be26 migrated from the Python difflib to the dissimilar crate so we can use the code across all platforms, but it unfortunately does not seem to perform as well for some languages/inputs. There appears to be a Rust port of difflib available, so it might be worth looking into whether we can use that instead, if it gives better output.

https://crates.io/crates/difflib

https://forums.ankiweb.net/t/error-highlighting-after-typing-the-answer/25755/6

@RumovZ feel free to take this if it interests you

@dae
Copy link
Member Author

dae commented Jan 9, 2023

We'll want to look into this as a matter of priority, as it appears that dissimilar will panic with certain non-Latin text input, eg

        let ctx = DiffContext::new("Сущность должна быть ответственна только за одно дело", "Single responsibility Сущность выполняет только одну задачу. Повод для изменения сущности только один.");

@dae dae added this to the 2.1.57 milestone Jan 9, 2023
@RumovZ
Copy link
Collaborator

RumovZ commented Jan 9, 2023

To be clear, that means the investigation part is over and we want to switch without question now?

@dae
Copy link
Member Author

dae commented Jan 9, 2023 via email

@dae
Copy link
Member Author

dae commented Jan 18, 2023

Closed via #2322

@dae dae closed this as completed Jan 18, 2023
@popyoung
Copy link

Still incorrect in 2.1.57

@dae
Copy link
Member Author

dae commented Jan 29, 2023

Please create a new issue and describe the problems you're having/provide reproduction steps.

@dae
Copy link
Member Author

dae commented Jan 29, 2023

Nevermind, I see you've posted in the forums. Please provide a card ID and the exact text you're entering, so I can try to reproduce the problem.

https://forums.ankiweb.net/t/bug-cloze-correction-doesnt-work-as-expected/26302/3

@popyoung
Copy link

CardID: 1667632350430
image
What I typed: He bribed one of these guard to smuggle out a note
Answer: He bribed one of the guards to smuggle out a note

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

No branches or pull requests

3 participants