How does Chrome decide what to highlight when you double-click Japanese text?

10/14 01:00
阅读数 0

问题:

If you double-click English text in Chrome, the whitespace-delimited word you clicked on is highlighted.如果您在 Chrome 中双击英文文本,则会突出显示您单击的以空格分隔的单词。 This is not surprising.这并不奇怪。 However, the other day I was clicking while reading some text in Japanese and noticed that some words were highlighted at word boundaries, even though Japanese doesn't have spaces.然而,前几天我在阅读一些日语文本时点击并注意到一些单词在单词边界处突出显示,即使日语没有空格。 Here's some example text:这是一些示例文本:

どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。如何

For example, if you click on 薄暗い, Chrome will correctly highlight it as a single word, even though it's not a single character class (this is a mix of kanji and hiragana).例如,如果您单击薄暗い,即使它不是单个字符类(这是汉字和平假名的混合),Chrome 也会正确地将其突出显示为单个单词。 Not all the highlights are correct, but they don't seem random.并非所有的亮点都是正确的,但它们似乎不是随机的。

How does Chrome decide what to highlight here? Chrome 如何决定在这里突出显示什么? I tried searching the Chrome source for "japanese word" but only found tests for an experimental module that doesn't seem active in my version of Chrome.我尝试在 Chrome 源代码中搜索“日语单词”,但只找到了一个在我的 Chrome 版本中似乎不活跃的实验模块的测试。


解决方案:

参考一: https://en.stackoom.com/question/4Alv3
参考二: https://stackoom.com/question/4Alv3
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部