How does the js Selection.modify function differentiate between words in Chinese?

31 views Asked by At

enter image description here

The function itself somehow understands when it is necessary to highlight 1 hieroglyph, when 2, and when all 3. I wonder how? Obviously this is not done using regular expressions. There are no separators between hieroglyphs (spaces, etc.). It feels like they almost connected AI to this Js function, although this is of course too redundant for that.

For example, this phrase is 大部分西方评论家似乎假设了最糟糕的情况. And judging by the translator, js selects individual words that are formed by groups of hieroglyphs.

enter image description here

0

There are 0 answers