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

Patches blank to tab #55

Merged
merged 3 commits into from
Jun 13, 2016
Merged

Conversation

aizuyan
Copy link
Contributor

@aizuyan aizuyan commented Jun 13, 2016

pathes中的words.txt中的拼音可能是用空格分隔的,这里做了兼容,如果是空格生成字典的时候转化为tab,统一起来

$patch_words = file(__DIR__.'/patches/words.txt');
foreach($patch_words as &$patch_word) {
list($word, $pinyin) = explode(",", trim($patch_word));
$pinyin = preg_replace("/ /", "\t", $pinyin);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

或许 /\s+/ 会更合适,因为万一别人用了多个空格

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实,考虑的有点不完善,修正了

@overtrue overtrue merged commit 5e12584 into overtrue:master Jun 13, 2016
@overtrue
Copy link
Owner

@aizuyan 👍

overtrue pushed a commit that referenced this pull request Nov 16, 2016
* 汉字拼音字典打patch的时候,增加兼容性,空格转为tab,统一起来

* 字典中空格转为统一的tab【\t】

* 空格替换为tab
overtrue pushed a commit that referenced this pull request Nov 16, 2016
* 汉字拼音字典打patch的时候,增加兼容性,空格转为tab,统一起来

* 字典中空格转为统一的tab【\t】

* 空格替换为tab
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