Skip to content

Add Python user_data access#342

Merged
hayashi-mas-wap merged 2 commits into
WorksApplications:develop-v0.7from
gulldan:feat/python-user-data
May 28, 2026
Merged

Add Python user_data access#342
hayashi-mas-wap merged 2 commits into
WorksApplications:develop-v0.7from
gulldan:feat/python-user-data

Conversation

@gulldan
Copy link
Copy Markdown
Contributor

@gulldan gulldan commented May 23, 2026

Summary

  • Expose Morpheme.user_data() in the Python bindings for both analyzed morphemes and standalone dictionary-entry morphemes.
  • Add user_data to Python field subsetting, type stubs, and subsetting docs, including an example for partial loading.
  • Also fix stale subsetting docs that referred to splits_a / splits_b; accepted field names are split_a / split_b.
  • Cover user-data access from tokenization, Dictionary.lookup(), Dictionary.entries(), lookup_all_entries(), and dictionaries built from user CSVs.

Root cause

The v0.7 Rust core already stores and resolves user_data, but the Python Morpheme API and Python field-subset parser did not expose or load that field.

Validation

  • cargo fmt --all
  • git diff --check
  • cargo test -p sudachi user_data
  • cargo test -p sudachipy
  • (cd python && python -m pip install -e .)
  • python -m unittest python.tests.test_build python.tests.test_morpheme python.tests.test_dictionary python.tests.test_tokenizer
  • python -m unittest python.tests.test_dictionary python.tests.test_morpheme
  • cargo test --workspace
  • python -m unittest discover python/tests

Closes #338

@gulldan gulldan force-pushed the feat/python-user-data branch from 1aadf64 to a7a7c5f Compare May 23, 2026 07:02
@gulldan gulldan changed the base branch from develop to develop-v0.7 May 23, 2026 07:02
@gulldan gulldan force-pushed the feat/python-user-data branch from a7a7c5f to 76a2150 Compare May 23, 2026 07:17
@gulldan gulldan force-pushed the feat/python-user-data branch from 76a2150 to dfca420 Compare May 23, 2026 07:31
@gulldan gulldan marked this pull request as ready for review May 26, 2026 08:31
@hayashi-mas-wap hayashi-mas-wap self-requested a review May 27, 2026 23:38
Comment thread python/tests/test_morpheme.py Outdated
@hayashi-mas-wap hayashi-mas-wap added this to the 0.7 milestone May 28, 2026
@hayashi-mas-wap hayashi-mas-wap merged commit 7197cdf into WorksApplications:develop-v0.7 May 28, 2026
1 check passed
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.

Add user data access for python

2 participants