Skip to content

Commit

Permalink
fix issue#82 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
drl3fty authored and overtrue committed May 16, 2018
1 parent 5f6d1fe commit c30a84e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Pinyin.php
Expand Up @@ -157,7 +157,7 @@ public function sentence($sentence, $withTone = false)
{
$marks = array_keys($this->punctuations);
$punctuationsRegex = preg_quote(implode(array_merge($marks, $this->punctuations)), '/');
$regex = '/[^üāēīōūǖáéíóúǘǎěǐǒǔǚàèìòùǜa-z0-9'.$punctuationsRegex.'\s_]+/iu';
$regex = '/[^üāēīōūǖáéíóúǘǎěǐǒǔǚàèìòùǜɑa-z0-9'.$punctuationsRegex.'\s_]+/iu';

$pinyin = preg_replace($regex, '', $this->romanize($sentence));

Expand Down Expand Up @@ -272,7 +272,7 @@ protected function convertSurname($string, $dictLoader)
*/
public function splitWords($pinyin, $option)
{
$split = array_filter(preg_split('/[^üāēīōūǖáéíóúǘǎěǐǒǔǚàèìòùǜa-z\d]+/iu', $pinyin));
$split = array_filter(preg_split('/[^üāēīōūǖáéíóúǘǎěǐǒǔǚàèìòùǜɑa-z\d]+/iu', $pinyin));

if (self::UNICODE !== $option) {
foreach ($split as $index => $pinyin) {
Expand Down

0 comments on commit c30a84e

Please sign in to comment.