Files
CN_Tool/tmp/generate_yilin_grade3_wordlist.js

303 lines
13 KiB
JavaScript
Raw Permalink Normal View History

const fs = require("fs");
const path = require("path");
const allUnits = [
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 1 Hello",
entries: [
["hello", "/h\u0259\u02c8l\u0259\u028a/", "\u4f60\u597d"],
["hi", "/ha\u026a/", "\u55e8\uff1b\u4f60\u597d"],
["good morning", "/\u02cc\u0261\u028ad \u02c8m\u0254\u02d0n\u026a\u014b/", "\u65e9\u4e0a\u597d"],
["Miss", "/m\u026as/", "\u5c0f\u59d0\uff1b\u8001\u5e08\u79f0\u547c"],
["class", "/kl\u0251\u02d0s/", "\u540c\u5b66\u4eec\uff1b\u73ed\u7ea7"],
["I", "/a\u026a/", "\u6211"],
["I'm = I am", "/a\u026am/", "\u6211\u662f"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 2 I'm Liu Tao",
entries: [
["are", "/\u0251\u02d0(r)/", "\u662f"],
["yes", "/jes/", "\u662f\uff1b\u5bf9"],
["no", "/n\u0259\u028a/", "\u4e0d\uff1b\u4e0d\u662f"],
["not", "/n\u0252t/", "\u4e0d\uff1b\u6ca1"],
["you", "/ju\u02d0/", "\u4f60\uff1b\u4f60\u4eec"],
["what", "/w\u0252t/", "\u4ec0\u4e48"],
["your", "/j\u0254\u02d0(r)/", "\u4f60\u7684"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 3 My friends",
entries: [
["my", "/ma\u026a/", "\u6211\u7684"],
["friend", "/frend/", "\u670b\u53cb"],
["he", "/hi\u02d0/", "\u4ed6"],
["she", "/\u0283i\u02d0/", "\u5979"],
["this", "/\u00f0\u026as/", "\u8fd9\uff1b\u8fd9\u4e2a"],
["is", "/\u026az/", "\u662f"],
["too", "/tu\u02d0/", "\u4e5f"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 4 My family",
entries: [
["family", "/\u02c8f\u00e6m\u0259li/", "\u5bb6\u5ead\uff1b\u5bb6\u4eba"],
["father", "/\u02c8f\u0251\u02d0\u00f0\u0259(r)/", "\u7236\u4eb2"],
["mother", "/\u02c8m\u028c\u00f0\u0259(r)/", "\u6bcd\u4eb2"],
["brother", "/\u02c8br\u028c\u00f0\u0259(r)/", "\u5144\uff1b\u5f1f"],
["sister", "/\u02c8s\u026ast\u0259(r)/", "\u59d0\uff1b\u59b9"],
["grandpa", "/\u02c8\u0261r\u00e6n(d)p\u0251\u02d0/", "\u7237\u7237\uff1b\u5916\u516c"],
["grandma", "/\u02c8\u0261r\u00e6n(d)m\u0251\u02d0/", "\u5976\u5976\uff1b\u5916\u5a46"],
["me", "/mi\u02d0/", "\u6211"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 5 Look at me",
entries: [
["look at", "/l\u028ak \u00e6t/", "\u770b"],
["T-shirt", "/\u02c8ti\u02d0 \u0283\u025c\u02d0t/", "T\u6064\u886b"],
["skirt", "/sk\u025c\u02d0t/", "\u88d9\u5b50"],
["cap", "/k\u00e6p/", "\u5e3d\u5b50"],
["jacket", "/\u02c8d\u0292\u00e6k\u026at/", "\u5939\u514b\u886b"],
["nice", "/na\u026as/", "\u597d\u770b\u7684\uff1b\u597d\u7684"],
["great", "/\u0261re\u026at/", "\u597d\u6781\u4e86"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 6 Colours",
entries: [
["red", "/red/", "\u7ea2\u8272"],
["orange", "/\u02c8\u0252r\u026and\u0292/", "\u6a59\u8272"],
["yellow", "/\u02c8jel\u0259\u028a/", "\u9ec4\u8272"],
["green", "/\u0261ri\u02d0n/", "\u7eff\u8272"],
["blue", "/blu\u02d0/", "\u84dd\u8272"],
["brown", "/bra\u028an/", "\u68d5\u8272"],
["white", "/wa\u026at/", "\u767d\u8272"],
["black", "/bl\u00e6k/", "\u9ed1\u8272"],
["and", "/\u00e6nd/", "\u548c"],
["now", "/na\u028a/", "\u73b0\u5728"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 7 Would you like a pie",
entries: [
["would like", "/w\u028ad la\u026ak/", "\u60f3\u8981"],
["pie", "/pa\u026a/", "\u9985\u997c"],
["cake", "/ke\u026ak/", "\u86cb\u7cd5"],
["egg", "/e\u0261/", "\u9e21\u86cb"],
["sweet", "/swi\u02d0t/", "\u7cd6\u679c\uff1b\u751c\u7684"],
["ice cream", "/\u02cca\u026as \u02c8kri\u02d0m/", "\u51b0\u6fc0\u51cc"],
["hot dog", "/\u02c8h\u0252t d\u0252\u0261/", "\u70ed\u72d7"],
["what about", "/w\u0252t \u0259\u02c8ba\u028at/", "\u2026\u2026\u600e\u4e48\u6837"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0a\u518c Unit 8 Happy New Year",
entries: [
["happy", "/\u02c8h\u00e6pi/", "\u9ad8\u5174\u7684\uff1b\u5feb\u4e50\u7684"],
["new", "/nju\u02d0/", "\u65b0\u7684"],
["year", "/j\u026a\u0259(r)/", "\u5e74"],
["Happy New Year", "/\u02cch\u00e6pi nju\u02d0 \u02c8j\u026a\u0259(r)/", "\u65b0\u5e74\u5feb\u4e50"],
["uncle", "/\u02c8\u028c\u014bkl/", "\u53d4\u53d4\uff1b\u8205\u8205"],
["aunt", "/\u0251\u02d0nt/", "\u963f\u59e8\uff1b\u59d1\u5988"],
["doll", "/d\u0252l/", "\u73a9\u5177\u5a03\u5a03"],
["ball", "/b\u0254\u02d0l/", "\u7403"],
["robot", "/\u02c8r\u0259\u028ab\u0252t/", "\u673a\u5668\u4eba"],
["toy car", "/t\u0254\u026a k\u0251\u02d0(r)/", "\u73a9\u5177\u5c0f\u6c7d\u8f66"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 1 In class",
entries: [
["in class", "/\u026an kl\u0251\u02d0s/", "\u5728\u4e0a\u8bfe"],
["open", "/\u02c8\u0259\u028ap\u0259n/", "\u6253\u5f00"],
["the", "/\u00f0\u0259/", "\u8fd9\uff1b\u90a3\uff08\u5b9a\u51a0\u8bcd\uff09"],
["door", "/d\u0254\u02d0(r)/", "\u95e8"],
["window", "/\u02c8w\u026and\u0259\u028a/", "\u7a97\u6237"],
["book", "/b\u028ak/", "\u4e66"],
["stand up", "/st\u00e6nd \u028cp/", "\u8d77\u7acb"],
["sit down", "/s\u026at da\u028an/", "\u5750\u4e0b"],
["please", "/pli\u02d0z/", "\u8bf7"],
["come in", "/k\u028cm \u026an/", "\u8fdb\u6765"],
["close", "/kl\u0259\u028az/", "\u5173\u4e0a"],
["blackboard", "/\u02c8bl\u00e6kb\u0254\u02d0d/", "\u9ed1\u677f"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 2 In the library",
entries: [
["library", "/\u02c8la\u026abr\u0259ri/", "\u56fe\u4e66\u9986"],
["shout", "/\u0283a\u028at/", "\u558a\uff1b\u53eb"],
["eat", "/i\u02d0t/", "\u5403"],
["run", "/r\u028cn/", "\u8dd1"],
["talk", "/t\u0254\u02d0k/", "\u8bf4\u8bdd"],
["sleep", "/sli\u02d0p/", "\u7761\u89c9"],
["drink", "/dr\u026a\u014bk/", "\u559d"],
["here", "/h\u026a\u0259(r)/", "\u8fd9\u91cc"],
["English", "/\u02c8\u026a\u014b\u0261l\u026a\u0283/", "\u82f1\u8bed"],
["milk", "/m\u026alk/", "\u725b\u5976"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 3 Is this your pencil",
entries: [
["pencil", "/\u02c8pensl/", "\u94c5\u7b14"],
["pen", "/pen/", "\u94a2\u7b14"],
["ruler", "/\u02c8ru\u02d0l\u0259(r)/", "\u5c3a"],
["rubber", "/\u02c8r\u028cb\u0259(r)/", "\u6a61\u76ae"],
["crayon", "/\u02c8kre\u026a\u0259n/", "\u8721\u7b14"],
["schoolbag", "/\u02c8sku\u02d0lb\u00e6\u0261/", "\u4e66\u5305"],
["pencil case", "/\u02c8pensl ke\u026as/", "\u94c5\u7b14\u76d2"],
["lunch box", "/\u02c8l\u028cnt\u0283 b\u0252ks/", "\u5348\u9910\u76d2"],
["where", "/we\u0259(r)/", "\u5728\u54ea\u91cc"],
["over there", "/\u02c8\u0259\u028av\u0259(r) \u00f0e\u0259(r)/", "\u5728\u90a3\u91cc"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 4 Where's the bird",
entries: [
["bird", "/b\u025c\u02d0d/", "\u9e1f"],
["under", "/\u02c8\u028cnd\u0259(r)/", "\u5728\u2026\u2026\u4e0b\u9762"],
["behind", "/b\u026a\u02c8ha\u026and/", "\u5728\u2026\u2026\u540e\u9762"],
["on", "/\u0252n/", "\u5728\u2026\u2026\u4e0a\u9762"],
["desk", "/desk/", "\u4e66\u684c"],
["chair", "/t\u0283e\u0259(r)/", "\u6905\u5b50"],
["in", "/\u026an/", "\u5728\u2026\u2026\u91cc\u9762"],
["tree", "/tri\u02d0/", "\u6811"],
["beautiful", "/\u02c8bju\u02d0t\u026afl/", "\u6f02\u4eae\u7684"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 5 How old are you",
entries: [
["one", "/w\u028cn/", "\u4e00"],
["two", "/tu\u02d0/", "\u4e8c"],
["three", "/\u03b8ri\u02d0/", "\u4e09"],
["four", "/f\u0254\u02d0(r)/", "\u56db"],
["five", "/fa\u026av/", "\u4e94"],
["six", "/s\u026aks/", "\u516d"],
["seven", "/\u02c8sevn/", "\u4e03"],
["eight", "/e\u026at/", "\u516b"],
["nine", "/na\u026an/", "\u4e5d"],
["ten", "/ten/", "\u5341"],
["how old", "/ha\u028a \u0259\u028ald/", "\u51e0\u5c81"],
["right", "/ra\u026at/", "\u5bf9\u7684\uff1b\u6b63\u786e\u7684"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 6 What time is it",
entries: [
["what time", "/w\u0252t ta\u026am/", "\u51e0\u70b9"],
["wake up", "/we\u026ak \u028cp/", "\u9192\uff1b\u9192\u6765"],
["o'clock", "/\u0259\u02c8kl\u0252k/", "\u2026\u2026\u70b9\u949f"],
["breakfast", "/\u02c8brekf\u0259st/", "\u65e9\u9910"],
["lunch", "/l\u028cnt\u0283/", "\u5348\u9910"],
["dinner", "/\u02c8d\u026an\u0259(r)/", "\u665a\u9910"],
["class", "/kl\u0251\u02d0s/", "\u8bfe\uff1b\u4e0a\u8bfe"],
["bed", "/bed/", "\u5e8a"],
["OK", "/\u02cc\u0259\u028a\u02c8ke\u026a/", "\u597d\uff1b\u53ef\u4ee5\u4e86"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 7 On the farm",
entries: [
["farm", "/f\u0251\u02d0m/", "\u519c\u573a"],
["they", "/\u00f0e\u026a/", "\u5b83\u4eec\uff1b\u4ed6\u4eec"],
["pig", "/p\u026a\u0261/", "\u732a"],
["cow", "/ka\u028a/", "\u5976\u725b"],
["chicken", "/\u02c8t\u0283\u026ak\u026an/", "\u9e21"],
["duck", "/d\u028ck/", "\u9e2d"],
["pear", "/pe\u0259(r)/", "\u68a8"],
["apple", "/\u02c8\u00e6pl/", "\u82f9\u679c"],
["orange", "/\u02c8\u0252r\u026and\u0292/", "\u6a59\u5b50"],
["those", "/\u00f0\u0259\u028az/", "\u90a3\u4e9b"]
]
},
{
title: "\u4e09\u5e74\u7ea7\u4e0b\u518c Unit 8 We're twins",
entries: [
["we", "/wi\u02d0/", "\u6211\u4eec"],
["we're = we are", "/w\u026a\u0259(r)/", "\u6211\u4eec\u662f"],
["twin", "/tw\u026an/", "\u53cc\u80de\u80ce\u4e4b\u4e00"],
["man", "/m\u00e6n/", "\u7537\u4eba"],
["woman", "/\u02c8w\u028am\u0259n/", "\u5973\u4eba"],
["boy", "/b\u0254\u026a/", "\u7537\u5b69"],
["girl", "/\u0261\u025c\u02d0l/", "\u5973\u5b69"],
["baby", "/\u02c8be\u026abi/", "\u5a74\u513f"],
["cousin", "/\u02c8k\u028czn/", "\u5802\uff08\u8868\uff09\u5144\u5f1f\u59d0\u59b9"],
["name", "/ne\u026am/", "\u540d\u5b57"]
]
}
];
function buildHtml(title, note, units) {
return `<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${title}</title>
<style>
body { font-family: "Microsoft YaHei", "SimSun", sans-serif; margin: 28px; line-height: 1.65; }
h1 { color: #4f378b; font-size: 20pt; margin: 0 0 12px; }
h2 { color: #2b4c7e; font-size: 14pt; margin: 18px 0 8px; border-bottom: 1px solid #d9e2f3; padding-bottom: 4px; }
p.note { color: #444; margin: 0 0 18px; font-size: 10.5pt; }
table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
td { border-bottom: 1px solid #eee; padding: 6px 4px; vertical-align: top; font-size: 11pt; }
td.word { color: #c00000; width: 28%; font-weight: 700; }
td.phonetic { color: #0066cc; width: 24%; }
td.meaning { color: #008000; width: 48%; }
</style>
</head>
<body>
<h1>${title}</h1>
<p class="note">${note}</p>
${units.map((unit) => `
<h2>${unit.title}</h2>
<table>
${unit.entries.map((entry) => `
<tr>
<td class="word">${entry[0]}</td>
<td class="phonetic">${entry[1]}</td>
<td class="meaning">${entry[2]}</td>
</tr>
`).join("")}
</table>
`).join("")}
</body>
</html>`;
}
function writeDoc(fileName, title, note, units) {
const outputPath = path.join(process.cwd(), fileName);
const html = buildHtml(title, note, units);
fs.writeFileSync(outputPath, "\uFEFF" + html, "utf8");
return outputPath;
}
const upperUnits = allUnits.filter((unit) => unit.title.includes("\u4e09\u5e74\u7ea7\u4e0a\u518c"));
const lowerUnits = allUnits.filter((unit) => unit.title.includes("\u4e09\u5e74\u7ea7\u4e0b\u518c"));
const outputs = [
writeDoc(
"\u6c5f\u82cf\u4e09\u5e74\u7ea7\u82f1\u8bed\u8bd1\u6797\u7248\u5355\u8bcd_\u4e0a\u4e0b\u518c_20260706.doc",
"\u6c5f\u82cf\u4e09\u5e74\u7ea7\u82f1\u8bed\u8bd1\u6797\u7248\u5355\u8bcd\u6c47\u603b",
"\u6574\u7406\u4e09\u5e74\u7ea7\u4e0a\u518c + \u4e0b\u518c\u3002\u82f1\u6587\u5355\u8bcd\u4e3a\u7ea2\u8272\uff0c\u97f3\u6807\u4e3a\u84dd\u8272\uff0c\u4e2d\u6587\u91ca\u4e49\u4e3a\u7eff\u8272\u3002",
allUnits
),
writeDoc(
"\u6c5f\u82cf\u4e09\u5e74\u7ea7\u82f1\u8bed\u8bd1\u6797\u7248\u4e0a\u518c\u5355\u8bcd_20260706.doc",
"\u6c5f\u82cf\u4e09\u5e74\u7ea7\u82f1\u8bed\u8bd1\u6797\u7248\u4e0a\u518c\u5355\u8bcd",
"\u4ec5\u5305\u542b\u4e09\u5e74\u7ea7\u4e0a\u518c\u3002\u82f1\u6587\u5355\u8bcd\u4e3a\u7ea2\u8272\uff0c\u97f3\u6807\u4e3a\u84dd\u8272\uff0c\u4e2d\u6587\u91ca\u4e49\u4e3a\u7eff\u8272\u3002",
upperUnits
),
writeDoc(
"\u6c5f\u82cf\u4e09\u5e74\u7ea7\u82f1\u8bed\u8bd1\u6797\u7248\u4e0b\u518c\u5355\u8bcd_20260706.doc",
"\u6c5f\u82cf\u4e09\u5e74\u7ea7\u82f1\u8bed\u8bd1\u6797\u7248\u4e0b\u518c\u5355\u8bcd",
"\u4ec5\u5305\u542b\u4e09\u5e74\u7ea7\u4e0b\u518c\u3002\u82f1\u6587\u5355\u8bcd\u4e3a\u7ea2\u8272\uff0c\u97f3\u6807\u4e3a\u84dd\u8272\uff0c\u4e2d\u6587\u91ca\u4e49\u4e3a\u7eff\u8272\u3002",
lowerUnits
)
];
outputs.forEach((outputPath) => console.log(outputPath));