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

add callback function to handle no pinyin character #17

Closed
wants to merge 0 commits into from
Closed

add callback function to handle no pinyin character #17

wants to merge 0 commits into from

Conversation

@liuyug
Copy link

@liuyug liuyug commented Jun 5, 2015

我想自己处理没有拼音的字符,加入回调函数

@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Jun 5, 2015

@liuyug 你觉得改为 errors 参数接受回调函数咋样?

errors 参数:

  • 如果是字符串,使用内置的处理函数
  • 如果是可调用对象,执行回调操作

@liuyug
Copy link
Author

@liuyug liuyug commented Jun 5, 2015

用errors参数也可以,或者为 str 或者为 func
但errors这个参数名字不好,容易引起混淆,应当改为其他名字,如 nopy ...

@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Jun 5, 2015

errors 参数名字取自 str.encode str.decode ,都是用于指定 无法正常处理的字符的处理方式

@liuyug
Copy link
Author

@liuyug liuyug commented Jun 8, 2015


那你来修改吧

mozillazg pushed a commit that referenced this issue Jun 9, 2015
@mozillazg
Copy link
Owner

@mozillazg mozillazg commented Jun 9, 2015

@liuyug 已改。你看一下是否满足你的需求。

@liuyug liuyug closed this Jun 10, 2015
@liuyug
Copy link
Author

@liuyug liuyug commented Jun 10, 2015

满足需求,谢谢。

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

2 participants