mirror of
https://github.com/zerosoul/chinese-colors.git
synced 2024-11-21 01:13:53 +08:00
fix: enable heteronym
This commit is contained in:
parent
4af7157695
commit
0114d35366
@ -25,7 +25,14 @@ const Colors = colors.map(set => {
|
||||
...c,
|
||||
RGB: convert.hex.rgb(c.hex),
|
||||
CMYK: convert.hex.cmyk(c.hex),
|
||||
pinyin: pinyin(c.name).join(' ')
|
||||
pinyin: pinyin(c.name, {
|
||||
heteronym: true, // 启用多音字模式
|
||||
segment: true // 启用分词,以解决多音字问题。
|
||||
})
|
||||
.map(item => {
|
||||
return item.length > 1 ? item[item.length - 1] : item;
|
||||
})
|
||||
.join(' ')
|
||||
};
|
||||
});
|
||||
return set;
|
||||
|
Loading…
Reference in New Issue
Block a user