@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | class Converter |
6 | 6 | { |
7 | 7 | private const SEGMENTS_COUNT = 10; |
8 | - private const WORDS_PATH = __DIR__.'/../data/words-%s.php'; |
|
9 | - private const CHARS_PATH = __DIR__.'/../data/chars.php'; |
|
10 | - private const SURNAMES_PATH = __DIR__.'/../data/surnames.php'; |
|
8 | + private const WORDS_PATH = __DIR__ . '/../data/words-%s.php'; |
|
9 | + private const CHARS_PATH = __DIR__ . '/../data/chars.php'; |
|
10 | + private const SURNAMES_PATH = __DIR__ . '/../data/surnames.php'; |
|
11 | 11 | |
12 | 12 | public const TONE_STYLE_SYMBOL = 'symbol'; |
13 | 13 | public const TONE_STYLE_NUMBER = 'number'; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | public function convert(string $string, callable $beforeSplit = null): Collection |
143 | 143 | { |
144 | 144 | // 把原有的数字和汉字分离,避免拼音转换时被误作声调 |
145 | - $string = preg_replace_callback('~[a-z0-9_-]+~i', function ($matches) { |
|
145 | + $string = preg_replace_callback('~[a-z0-9_-]+~i', function($matches) { |
|
146 | 146 | return "\t" . $matches[0]; |
147 | 147 | }, $string); |
148 | 148 |