1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
程序员小墨 2022-12-08 23:00:21 +08:00
parent dac5a5c471
commit aa8aae4b4a
5 changed files with 223860 additions and 8589 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

37
original/4/convert.js Normal file
View File

@ -0,0 +1,37 @@
const fs = require('fs');
const path = require('path');
const utils = require('../../utils');
const input = fs.readFileSync(path.join(__dirname, './data.txt'), 'utf8')
let list = input.trim().replace(/[\r\n]+/g, "\n").split("\n")
console.log(list)
let radical = ""
let isWord = false
let pinyin = []
for (let i = 0; i < list.length; i++) {
const item = list[i].trim()
let match = item.match(/(.) 字母开头的汉字/)
if (match) {
// 新的字母开头开始了
radical = match[1]
} else {
// 这是汉字或者拼音
if (!isWord) {
// 拼音
pinyin = item.split(' ').sort()
} else {
// 汉字
let struct = utils.structure()
struct.word = item
struct.pinyin = pinyin
struct.from.push("4")
utils.addData(struct, false)
// console.log(item, pinyin)
}
isWord = !isWord
}
}
utils.saveData()
console.log("done")

74418
original/4/data.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
1 https://zhuanlan.zhihu.com/p/429504173
2 https://baike.baidu.com/item/%E5%B8%B8%E7%94%A8%E5%AD%97/10071115?fr=aladdin
3 https://m.gdzz114.com/shengpizi.html
3 https://m.gdzz114.com/shengpizi.html
4 https://m.gdzz114.com/dictionary/a.html