Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: mozillazg <485054+mozillazg@users.noreply.github.com>
Co-authored-by: mozillazg <485054+mozillazg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] 新增一个函数用于实现对结果进行分组输出
Add pinyin_group function for grouped pinyin output with erhua and apostrophe handling
Oct 6, 2025
mozillazg
reviewed
Oct 6, 2025
Owner
…up method Co-authored-by: mozillazg <485054+mozillazg@users.noreply.github.com>
mozillazg
reviewed
Oct 6, 2025
Owner
Co-authored-by: mozillazg <485054+mozillazg@users.noreply.github.com>
Copilot
AI
changed the title
Add pinyin_group function for grouped pinyin output with erhua and apostrophe handling
Add pinyin_group and lazy_pinyin_group functions for grouped pinyin output with erhua and apostrophe handling
Oct 6, 2025
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fix flake8 errors: E129 (visual indent), E501 (line too long), F401 (unused import).
Owner
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
* chore: migrate project management and CI/CD to uv - Add pyproject.toml and uv.lock for uv-based dependency management. - Update Makefile to use 'uv build' for package building. - Update .github/workflows/ci.yml to use astral-sh/setup-uv and uv commands. - Update .circleci/config.yml to install and use uv for testing. - Add uv installation instructions to README.rst and README_en.rst. * fix ci * no longer support pypy2 * use astral-sh/setup-uv@v7
…b-dabd-4427-9b7a-3261a7d65bf9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successfully implemented pinyin grouping functions with two variants for different use cases:
New Functions
1.
pinyin_group()andlazy_pinyin_group()pinyin_group: Returns pinyin as a list (supports multi-pronunciation withheteronym=True)lazy_pinyin_group: Returns pinyin as a string (single pronunciation only, simpler output)Both functions:
Handle erhua (儿化音) - combine 儿 with previous characterImplementation Details
Architecture (following existing patterns)
Pinyin.pinyin_group()andPinyin.lazy_pinyin_group()methods in thePinyinclasspinyin()/lazy_pinyin()functionsKey Differences
pinyin_group:
[{'hanzi': '你好', 'pinyin': ['ni hao']}] # pinyin is a listlazy_pinyin_group:
[{'hanzi': '你好', 'pinyin': 'ni hao'}] # pinyin is a stringUse Cases
pinyin_group: When you need multi-pronunciation support or consistency with other functionslazy_pinyin_group: Simpler output for common cases where single pronunciation is sufficient<ruby>tag integration for annotating Chinese textTesting
Exports
Both functions are exported from
pypinyin/__init__.py:pinyin_grouplazy_pinyin_groupType hints added to
.pyifiles for both functions and methods.Closes #245
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.