Skip to content

Commit af51b33

Browse files
committed
Add more punctuations as word separators
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent 9e649d8 commit af51b33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Renderer/Html/LineRenderer/Word.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ class Word extends AbstractLineRenderer
1515
*/
1616
public function render(MbString $mbFrom, MbString $mbTo): LineRendererInterface
1717
{
18-
static $punctuations = ' $,.:;!?\'"()\[\]{}%@<=>_+\-*\/~\\\\|';
18+
static $punctuations = (
19+
' $,.:;!?\'"()\[\]{}%@<=>_+\-*\/~\\\\|' .
20+
' $,.:;!?’"()[]{}%@<=>_+-*/~\|' .
21+
'「」『』〈〉《》【】())(‘’“”' .
22+
'.‧・・•·'
23+
);
1924

2025
$fromWords = $mbFrom->toArraySplit("/([{$punctuations}])/uS", -1, \PREG_SPLIT_DELIM_CAPTURE);
2126
$toWords = $mbTo->toArraySplit("/([{$punctuations}])/uS", -1, \PREG_SPLIT_DELIM_CAPTURE);

0 commit comments

Comments
 (0)