Skip to content

Commit

Permalink
fix Pinyin determination
Browse files Browse the repository at this point in the history
  • Loading branch information
Boldewyn committed Mar 20, 2024
1 parent f145765 commit cff7d62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codepoints.net/lib/Unicode/CodepointInfo/Pronunciation.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public function __invoke(Codepoint $codepoint) : ?string {
$pr = preg_replace('/^([\p{L}\p{N}]+).*/u', '$1',
(string)$props['kHanyuPinlu']);
} elseif ($props['kXHC1983'] ?? null) {
$pr = preg_replace('/^[0-9.*,]+:([^ ,]+)(?:[ ,].*)?$/', '$1',
$pr = preg_replace('/^[0-9.*,]+:([^ ,]+)(?:[ ,].*)?$/u', '$1',
(string)$props['kXHC1983']);
} elseif ($props['kHanyuPinyin'] ?? null) {
$pr = preg_replace('/^[0-9.*,]+:([^ ,]+)(?:[ ,].*)?$/', '$1',
$pr = preg_replace('/^[0-9.*,]+:([^ ,]+)(?:[ ,].*)?$/u', '$1',
(string)$props['kHanyuPinyin']);
} elseif ($props['kMandarin'] ?? null) {
$pr = strtolower(preg_replace('/^([\p{L}\p{N}]+).*/', '$1',
$pr = strtolower(preg_replace('/^([\p{L}\p{N}]+).*/u', '$1',
(string)$props['kMandarin']));
}
return $pr;
Expand Down

0 comments on commit cff7d62

Please sign in to comment.