使用新的拼音库

This commit is contained in:
Spmario233 2024-05-10 17:11:17 +08:00
parent 71c581c7dd
commit 9868cae9ce
5 changed files with 12544 additions and 13 deletions

View File

@ -420,7 +420,6 @@ window.noname_source_list = [
"game/NoSleep.js", "game/NoSleep.js",
"game/package.js", "game/package.js",
"game/phantom.js", "game/phantom.js",
"game/pinyinjs.js",
"game/pressure.js", "game/pressure.js",
"game/server.js", "game/server.js",
"game/source.js", "game/source.js",

View File

@ -7,6 +7,7 @@ import { CacheContext } from "../library/cache/cacheContext.js";
import { Is } from "./is.js"; import { Is } from "./is.js";
import { Promises } from "./promises.js"; import { Promises } from "./promises.js";
import { rootURL } from "../../noname.js"; import { rootURL } from "../../noname.js";
import * as pinyinPro from "./pinyins/index.js";
export class Get { export class Get {
is = new Is(); is = new Is();
@ -214,22 +215,32 @@ export class Get {
} }
//装备栏 END //装备栏 END
/** /**
* @returns { string[] } * @param {string} chinese
* @param {boolean|undefined} withTone
* @returns { any[] }
*/ */
pinyin(chinese, withTone) { pinyin(chinese, withTone) {
const pinyinUtilx = window.pinyinUtilx; let result = [];
if (!pinyinUtilx) return [];
const pinyins = lib.pinyins; const pinyins = lib.pinyins;
if (pinyins) { if (pinyins && pinyins[chinese] && Array.isArray(pinyins[chinese])) {
const pinyin = pinyins[chinese]; result = pinyins[chinese].slice(0);
if (Array.isArray(pinyin)) return withTone === false ? pinyin.map(pinyinUtilx.removeTone) : pinyin.slice();
} }
return pinyinUtilx.getPinyin(chinese, null, withTone, true); else {
//@ts-ignore
result = pinyinPro.pinyin(chinese, {type: "array"});
} }
//@ts-ignore
if (withTone === false) result = pinyinPro.convert(result, { format: "toneNone" });
return result;
}
/**
* @param { string } str
* @returns { string }
*/
yunmu(str) { yunmu(str) {
//部分整体认读音节特化处理 //部分整体认读音节特化处理
const util = window.pinyinUtilx; //@ts-ignore
if (util && lib.pinyins._metadata.zhengtirendu.includes(util.removeTone(str))) { if (lib.pinyins._metadata.zhengtirendu.includes(pinyinPro.convert(str, { format: "toneNone" }))) {
return "-" + str[str.length - 1]; return "-" + str[str.length - 1];
} }
//排除声母 //排除声母
@ -278,9 +289,13 @@ export class Get {
} }
return str; return str;
} }
/**
* @param { string } str
* @returns { string|null }
*/
yunjiao(str) { yunjiao(str) {
const util = window.pinyinUtilx; //@ts-ignore
if (util) str = util.removeTone(str); str = pinyinPro.convert(str, { format: "toneNone" })
if (lib.pinyins._metadata.zhengtirendu.includes(str)) { if (lib.pinyins._metadata.zhengtirendu.includes(str)) {
str = "-" + str[str.length - 1]; str = "-" + str[str.length - 1];
} else { } else {

12345
noname/get/pinyins/index.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,173 @@
const dictionary = {
用间: ["yòng jiàn"],
乐进: ["yuè jìn"],
乐就: ["yuè jiù"],
乐綝: ["yuè chēn"],
华歆: ["huà xīn"],
华雄: ["huà xióng"],
贾诩: ["jiǎ xǔ"],
贾逵: ["jiǎ kuí"],
贾充: ["jiǎ chōng"],
沮授: ["jū shòu"],
纪灵: ["jǐ líng"],
笮融: ["zé róng"],
逢纪: ["páng jì"],
许褚: ["xǔ chǔ"],
刘辟: ["liú pì"],
刘禅: ["liú shàn"],
甄宓: ["zhēn fú"],
孙綝: ["sūn chēn"],
李傕: ["lǐ jué"],
李遗: ["lǐ wèi"],
张嶷: ["zhāng nì"],
蒋干: ["jiǎng gàn"],
雷薄: ["léi bó"],
吕蒙: ["lǚ méng"],
于禁: ["yú jìn"],
赵累: ["zhào lèi"],
夏侯令女: ["xià hóu lìng nǚ"],
马日磾: ["mǎ mì dī"],
史阿: ["shǐ ē"],
凯撒: ["kǎi sà"],
乐无异: ["yuè wú yì"],
端蒙: ["duān méng"],
妹喜: ["mò xǐ"],
洛欧塞布: ["luò ōu sài bù"],
塞纳留斯: ["sài nà liú sī"],
半藏: ["bàn zàng"],
地藏王: ["dì zàng wáng"],
查莉娅: ["zhā lì yà"],
单小小: ["shàn xiǎo xiǎo"],
少微: ["shào wēi"],
少昊: ["shào hào"],
欧阳少恭: ["ōu yáng shào gōng"],
卡尔维特: ["kǎ ěr wéi tè"],
卡西尔: ["kǎ xī ěr"],
卡扎库斯: ["kǎ zā kù sī"],
卡德加: ["kǎ dé jiā"],
法兰茜斯卡: ["fǎ lán qiàn sī kǎ"],
卡利莫斯: ["kǎ lì mò sī"],
安卡: ["ān kǎ"],
卡玛: ["kǎ mǎ"],
梼杌: ["táo wù"],
亚煞极: ["yà shà jí"],
库特莉亚芙卡: ["kù tè lì yà fú kǎ"],
露娜: ["lù nà"],
弹雀: ["tán què"],
重身: ["chóng shēn"],
畜鸣: ["chù míng"],
聆乐: ["líng yuè"],
没矢: ["mò shǐ"],
没欲: ["mò yù"],
血裔: ["xuè yì"],
血卫: ["xuè wèi"],
血诏: ["xuè zhào"],
血偿: ["xuè cháng"],
血拼: ["xuè pīn"],
血途: ["xuè tú"],
行殇: ["xíng shāng"],
节行: ["jié xíng"],
天行: ["tiān xíng"],
神行: ["shén xíng"],
镇行: ["zhèn xíng"],
行图: ["xíng tú"],
绝行: ["jué xíng"],
好施: ["hào shī"],
荐降: ["jiàn xiáng"],
破降: ["pò xiáng"],
拒降: ["jù xiáng"],
应势: ["yìng shì"],
应援: ["yìng yuán"],
应机: ["yìng jī"],
节应: ["jié yìng"],
驰应: ["chí yìng"],
断发: ["duàn fà"],
旋风: ["xuàn fēng"],
将驰: ["jiàng chí"],
将烈: ["jiàng liè"],
将略: ["jiàng lüè"],
斩将: ["zhǎn jiàng"],
拜将: ["bài jiàng"],
强识: ["qiáng zhì"],
默识: ["mò zhì"],
数谏: ["shuò jiàn"],
巧说: ["qiǎo shuì"],
营说: ["yíng shuì"],
说盟: ["shuì méng"],
落宠: ["luò chǒng"],
落雁: ["luò yàn"],
落雷: ["luò léi"],
贲育: ["bēn yù"],
造王: ["zào wàng"],
舍宴: ["shě yàn"],
舍裔: ["shě yì"],
省身: ["xǐng shēn"],
单骑: ["dān jì"],
间书: ["jiàn shū"],
伏间: ["fú jiàn"],
间计: ["jiàn jì"],
贵相: ["guì xiàng"],
相鼠: ["xiàng shǔ"],
辟田: ["pì tián"],
辟撰: ["pì zhuàn"],
辟境: ["pì jìng"],
斗阵: ["dòu zhèn"],
斗缠: ["dòu chán"],
冯河: ["píng hé"],
势吓: ["shì hè"],
虚吓: ["xū hè"],
叱吓: ["chì hè"],
度断: ["duó duàn"],
度势: ["duó shì"],
诛綝: ["zhū chēn"],
大喝: ["dà hè"],
暴喝: ["bào hè"],
曲误: ["qǔ wù"],
媛丽: ["yuán lì"],
调归: ["diào guī"],
款塞: ["kuǎn sài"],
父荫: ["fù yìn"],
穆荫: ["mù yìn"],
长姬: ["zhǎng jī"],
朝凤: ["cháo fèng"],
朝争: ["cháo zhēng"],
令法: ["lìng fǎ"],
耀令: ["yào lìng"],
冠绝: ["guàn jué"],
先著: ["xiān zhuó"],
量反: ["liàng fǎn"],
复难: ["fù nàn"],
膴仕: ["wǔ shì"],
蒙斥: ["méng chì"],
乐动: ["yuè dòng"],
血凰: ["xuè huáng"],
血戮: ["xuè lù"],
血刃: ["xuè rèn"],
血契: ["xuè qì"],
血逐: ["xuè zhú"],
血咒: ["xuè zhòu"],
血殇: ["xuè shāng"],
血池: ["xuè chí"],
越行: ["yuè xíng"],
侠行: ["xiá xíng"],
枭行: ["xiāo xíng"],
劫行: ["jié xíng"],
割发: ["gē fà"],
落梅: ["luò méi"],
落石: ["luò shí"],
落刀: ["luò dāo"],
星落: ["xīng luò"],
奈落: ["nài luò"],
舍身: ["shě shēn"],
舍愿: ["shě yuàn"],
月露: ["yuè lù"],
沾露: ["zhān lù"],
禁咒: ["jìn zhòu"],
挟令: ["xié lìng"],
七煞: ["qī shà"],
冥煞: ["míng shà"],
虎煞: ["hǔ shà"],
煞魂: ["shà hún"],
};
export default dictionary;

View File

@ -2441,7 +2441,6 @@ export class Create {
}); });
} }
} }
lib.init.js(lib.assetURL + "game", "pinyinjs", function () {});
lib.init.js(lib.assetURL + "game", "keyWords", function () {}); lib.init.js(lib.assetURL + "game", "keyWords", function () {});
lib.updateURL = lib.updateURL =