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

fix dictionary.__repr__ for no user-dict case #282

Merged

Conversation

mh-northlander
Copy link
Collaborator

@mh-northlander mh-northlander commented Dec 2, 2024

current __repr__ misses close "]" when the user dict list is empty:

dict = sudachipy.Dictionary()
dict.__repr__()
# '<SudachiDictionary(system=/path/to/system.dic, user=[)>'

python/src/dictionary.rs Outdated Show resolved Hide resolved
@mh-northlander
Copy link
Collaborator Author

Vec<T> does not have the display trait and we need to write.
https://doc.rust-jp.rs/rust-by-example-ja/hello/print/print_display.html

I chose to branch at index=0.

@mh-northlander mh-northlander merged commit 09af4eb into WorksApplications:develop Dec 4, 2024
8 checks passed
@mh-northlander mh-northlander deleted the fix/dictionary-repr branch December 4, 2024 07:20
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.

2 participants