diff --git a/data/words-7.php b/data/words-7.php index 4d752a4e..79878225 100644 --- a/data/words-7.php +++ b/data/words-7.php @@ -6284,7 +6284,7 @@ '琟' => ' wéi ', '琠' => ' tiǎn ', '琡' => ' chù ', - '琢' => ' zuó ', + '琢' => ' zhuó ', '琣' => ' běng ', '琤' => ' chēng ', '琥' => ' hǔ ', diff --git a/sources/pathes/chars.txt b/sources/pathes/chars.txt index bda0758f..04dceebd 100644 --- a/sources/pathes/chars.txt +++ b/sources/pathes/chars.txt @@ -1,2 +1,3 @@ U+55EF: ǹ # 嗯 U+2E81: fǎn # ⺁ +U+7422: zhuó,zuó # 琢 diff --git a/src/Converter.php b/src/Converter.php index a892df42..ef90d2ed 100644 --- a/src/Converter.php +++ b/src/Converter.php @@ -175,7 +175,7 @@ public function when(bool $condition, callable $callback): static return $this; } - public function convert(string $string, ?callable $beforeSplit = null): Collection + public function convert(string $string, callable $beforeSplit = null): Collection { // 把原有的数字和汉字分离,避免拼音转换时被误作声调 $string = preg_replace_callback('~[a-z0-9_-]+~i', function ($matches) { diff --git a/tests/PinyinTest.php b/tests/PinyinTest.php index 3810be4b..20783534 100755 --- a/tests/PinyinTest.php +++ b/tests/PinyinTest.php @@ -414,6 +414,9 @@ public function test_issues() // https://github.com/overtrue/pinyin/issues/200 $this->assertPinyin(['pú', 'ōu'], Pinyin::sentence('仆区')); + // https://github.com/overtrue/pinyin/issues/207 + $this->assertPinyin(['zhuó'], Pinyin::sentence('琢')); + // https://github.com/overtrue/pinyin/issues/195 $this->assertSame([ '你' => ['ni3'],