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

新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 #147

Merged
merged 10 commits into from Dec 5, 2018

Conversation

@howl-anderson
Copy link
Contributor

@howl-anderson howl-anderson commented Nov 30, 2018

PR 描述

代码:

from pypinyin import pinyin

result = pinyin('你好!🙂', errors=lambda x: [i for i in x])
print(result)

改动前输出:

[['nǐ'], ['hǎo'], ['!🙂']]

改动后输出:

[['nǐ'], ['hǎo'], ['!'], ['🙂']]

其他内置 errors 处理选项功能不变

待办事项

  • 符合代码规范
  • 单元测试
  • 文档
@pep8speaks
Copy link

@pep8speaks pep8speaks commented Nov 30, 2018

Hello @howl-anderson! Thanks for updating the PR.

Comment last updated on November 30, 2018 at 15:23 Hours UTC

Loading

@howl-anderson howl-anderson changed the title [WIP]新特性:errors 为 callable 对象时,返回 list 将会在最终结果里 extend 列表元素 [WIP]新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 Nov 30, 2018
@codecov
Copy link

@codecov codecov bot commented Nov 30, 2018

Codecov Report

Merging #147 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #147   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           20     20           
  Lines          527    527           
  Branches        80     81    +1     
======================================
  Hits           527    527
Impacted Files Coverage Δ
pypinyin/core.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6562604...40942d7. Read the comment docs.

Loading

@mozillazg mozillazg self-requested a review Dec 2, 2018
@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Dec 2, 2018

@howl-anderson Thanks for your PR! 待我有空的时候看一下。

Loading

@mozillazg mozillazg changed the base branch from master to develop Dec 2, 2018
@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Dec 2, 2018

@howl-anderson 麻烦 rebase 一下 develop 分支的代码,CI 中依赖的 coveralls 有点问题会导致 CI 失败,已经在 develop 分支中删除 coveralls 依赖。

Loading

@howl-anderson howl-anderson changed the title [WIP]新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 Dec 2, 2018
@howl-anderson
Copy link
Contributor Author

@howl-anderson howl-anderson commented Dec 2, 2018

@howl-anderson 麻烦 rebase 一下 develop 分支的代码,CI 中依赖的 coveralls 有点问题会导致 CI 失败,已经在 develop 分支中删除 coveralls 依赖。

Done!

Loading

@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Dec 5, 2018

@howl-anderson Thanks for your contribution. I'll release new version soon.

Loading

@mozillazg mozillazg merged commit b1cfafd into mozillazg:develop Dec 5, 2018
9 checks passed
Loading
@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Dec 8, 2018

@howl-anderson 最新 0.34.0 版本的 pypinyin 已包含这个 PR 的改动。

Loading

@howl-anderson
Copy link
Contributor Author

@howl-anderson howl-anderson commented Dec 8, 2018

@mozillazg Awesome! Thank you!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants