chengjie 2 月之前
父节点
当前提交
8eb0b71fbb

+ 167 - 0
src/api/miaoguo/literacyController.js

@@ -0,0 +1,167 @@
1
+import moment from 'moment';
2
+import fs from 'fs';
3
+import { promises as fsPromises } from 'fs';
4
+import commonModel from '../../model/commonModel.js';
5
+import config from '../../config/index.js';
6
+import _ from 'lodash';
7
+import axios from 'axios';
8
+import { Encrypt, Decrypt } from '../../util/crypto/index.js';
9
+import { stringUtils } from '../../util/stringClass.js';
10
+import WXBizDataCrypt from '../../util/WXBizDataCrypt.js';
11
+import { globalCache } from '../../util/GlobalCache.js';
12
+import constantClass from '../../util/constant/index.js';
13
+import aiController from '../../api/yjbdc/aiController.js';
14
+import miaoguo from '../../model/miaoguo.js';
15
+
16
+
17
+//获得加资料数据
18
+export async function GetMiaoguoAISearch(ctx) {
19
+    let param = {
20
+        UserID: ctx.query.UserID || "",
21
+        Word: ctx.query.Word || "",
22
+        Author: ctx.query.Author || "",
23
+        SearchType: ctx.query.SearchType || "",
24
+        ShiciUrl: ctx.query.ShiciUrl || "",
25
+    };
26
+
27
+    let isNew=false;
28
+    if (param.SearchType=="zici" && param.Word.indexOf(" [ ")>0 && param.Word.indexOf(" ] ")>0){
29
+        param.Word=param.Word.substring(0,param.Word.indexOf(" [ ")-1);
30
+    }
31
+
32
+    // 使用单词作为缓存键,为每个单词单独缓存结果
33
+    const cacheKey = `GetMiaoguoAISearch_${param.Word}_${param.SearchType}_${param.Author}_${param.ShiciUrl}`;
34
+    let result = globalCache.get(cacheKey);
35
+
36
+    if (!result) {
37
+        // 缓存未命中,从数据库获取
38
+        let literacyItem=await miaoguo.GetLiteracyItem(param);
39
+        if (literacyItem && literacyItem.length>0){
40
+            //console.log("Old Word");
41
+            //console.log("2:"+moment().format("mm:ss"));
42
+            for(let i=0;i<literacyItem.length;i++){
43
+                if (literacyItem[i].SearchType=="list"){
44
+                    literacyItem[0]=literacyItem[i];
45
+                    param.SearchType="list";
46
+                    break;
47
+                }
48
+            }
49
+            if (param.SearchType!="list" && literacyItem.length>0){
50
+                result=[];
51
+                param.SearchType="list";
52
+                for(let i=0;i<literacyItem.length;i++){
53
+                    let obj={};
54
+                    if (literacyItem[i].SearchType=="zici"){
55
+                        obj.Type="zici";
56
+                        obj.Key=param.Word;
57
+                        obj.TypeName="字词";
58
+                    }
59
+                    else if (literacyItem[i].SearchType=="eng"){
60
+                        obj.Type="eng";
61
+                        obj.Key=param.Word;
62
+                        obj.TypeName="翻译";
63
+                    }
64
+                    result.push(obj);
65
+                }
66
+            }
67
+
68
+            if (param.SearchType!="list"){
69
+                //console.log(literacyItem[0].JSONString);
70
+                literacyItem[0].JSONString=stringUtils.ReplaceAllString(literacyItem[0].JSONString,"&#x27;","ˈ");
71
+                
72
+                result=JSON.parse(literacyItem[0].JSONString);
73
+                //console.log("3:"+moment().format("mm:ss"));
74
+                //查找英语词频
75
+                if (!stringUtils.IsChineseSentence(param.Word)){
76
+                    param.Word=stringUtils.ReplaceAllString(param.Word,"'","ˈ");
77
+                    let sql ="select FinallyNum from WordFrequency where Word='"+param.Word+"';";
78
+                    //console.log(sql);
79
+                    let list=await commonModel.RunSql({},sql);
80
+                    let id=0;
81
+                    if (list && list.length>0)
82
+                        id=list[0].FinallyNum;
83
+                    if (id>0){
84
+                        result.ENG.WordFrequency=getWordFrequency(id);
85
+                    }
86
+
87
+                    let sql2 ="Select m.ID,m.Category,m.LibraryName1,m.LibraryName2,w.LessonID from Words w inner join MiaoguoBook m on w.BookID=m.BookIDOld where w.BookID in (191,192,193,194,195,196,197,198,205,206,207,208,209,210,211) and w.Word='"+param.Word+"';";
88
+                    //console.log(sql);
89
+                    let list2=await commonModel.RunSql({},sql2);
90
+                    let arrTemp=[];
91
+                    for(let i=0;i<list2.length;i++){
92
+                        let str ="知识包 英语 \\ "+ list2[i].LibraryName1+list2[i].LibraryName2+" \\ 单元词汇 \\ Unit "+list2[i].LessonID;
93
+                        
94
+                        arrTemp.push(str);
95
+                        //console.log(str);
96
+                    }
97
+                    if (result.ENG)
98
+                        result.ENG.Book=arrTemp;
99
+                }
100
+                //单个汉字,查找是否在人教版中
101
+                if (stringUtils.IsChineseSentence(param.Word) && param.Word.length==1){
102
+                    let sql = "select b.Name,u.Name as 'Name2' from HanziUnit u inner join HanziBook b on u.HanziBookID=b.ID where ((b.ID>=13 and b.ID<=24) or (b.ID>=61 and b.ID<=72)) and u.Example like '%"+param.Word+"%' order by b.Name;";
103
+                    //console.log(sql);
104
+                    let list=await commonModel.RunSql({},sql);
105
+                    if (list && list.length>0) {
106
+
107
+                        let arrTemp=[];
108
+                        for(let i=0;i<list.length;i++){
109
+                            let str = list[i].Name;
110
+                            let str2="写字";
111
+                            if (str.indexOf("识字")>0)
112
+                                str2="识字";
113
+                            str = str.replace("写字能力","");
114
+                            str = str.replace("识字能力","");
115
+                            let str3 ="知识包 语文 \\ "+ str+"学期 \\ "+str2+" \\ "+list[i].Name2;
116
+                            arrTemp.push(str3);
117
+                            //console.log(str);
118
+                        }
119
+                        if (result.CHN)
120
+                            result.CHN.Book=arrTemp;
121
+                    }
122
+                }
123
+            }
124
+            //console.log("4:"+moment().format("mm:ss"));
125
+            result={"errcode": 10000, result: result}
126
+        }
127
+        else{
128
+            console.log("New Word");
129
+            isNew=true;
130
+            //如果是英文单词
131
+            if ((stringUtils.IsEnglish(param.Word)) || param.SearchType!="eng"){
132
+            
133
+            }
134
+            //整句中是否有中文
135
+            else if ((stringUtils.IsChineseSentence(param.Word)) && param.SearchType!="eng") {
136
+            
137
+            }
138
+        }
139
+    }
140
+
141
+    
142
+
143
+    ctx.body = result;
144
+}
145
+
146
+function getWordFrequency(id){
147
+    var result={};
148
+    if (id==0){
149
+        result={Min:0,Max:0};
150
+    }
151
+    else if (id>0 && id<=220){
152
+        result={Min:1,Max:220};
153
+    }
154
+    else if (id<=2000){
155
+        var num=Math.floor(id/100)*100;
156
+        result={Min:num,Max:Number(num+100)};
157
+    }
158
+    else if (id<=10000){
159
+        var num=Math.floor(id/500)*500;
160
+        result={Min:num,Max:Number(num+500)};
161
+    }
162
+    else{
163
+        var num=Math.floor(id/1000)*1000;
164
+        result={Min:num,Max:Number(num+1000)};
165
+    }
166
+    return result;
167
+}

+ 8 - 0
src/api/miaoguo/routes.js

@@ -0,0 +1,8 @@
1
+import Router from 'koa-router';
2
+import * as literacyController from './literacyController.js';
3
+
4
+const router = new Router();
5
+
6
+router.get('/api/GetMiaoguoAISearch',literacyController.GetMiaoguoAISearch);
7
+
8
+export default router;

+ 2 - 2
src/api/yjbdc/aiController.js

@@ -494,8 +494,8 @@ class AIProviderFactory {
494 494
             case 'doubao-kimi-k2-250711':
495 495
                 return new VolcesAIProvider("kimi-k2-250711");
496 496
 
497
-            case 'ali-qwen-plus-2025-07-28':
498
-                return new AliyunAIProvider("qwen-plus-2025-07-28");
497
+            case 'ali-qwen-plus-2025-07-14':
498
+                return new AliyunAIProvider("qwen-plus-2025-07-14");
499 499
             case 'ali-qwen-max':
500 500
                 return new AliyunAIProvider("qwen-max");
501 501
             case 'llama-4-scout-17b-16e-instruct':

+ 3 - 0
src/app.js

@@ -15,6 +15,7 @@ import yjbdcRouter from './api/yjbdc/routes.js';
15 15
 import phonicsRouter from './api/phonics/routes.js';
16 16
 import pinyinRouter from './api/pinyin/routes.js';
17 17
 import hanziRouter from './api/hanzi/routes.js';
18
+import miaoguoRouter from './api/miaoguo/routes.js';
18 19
 import mathcalculateRouter from './api/mathcalculate/routes.js';
19 20
 import webRouter from './api/web/routes.js';
20 21
 
@@ -84,6 +85,8 @@ app.use(webRouter.routes());
84 85
 app.use(webRouter.allowedMethods());
85 86
 app.use(yjbdcRouter.routes());
86 87
 app.use(yjbdcRouter.allowedMethods());
88
+app.use(miaoguoRouter.routes());
89
+app.use(miaoguoRouter.allowedMethods());
87 90
 
88 91
 
89 92
 // 启动服务器

+ 33 - 0
src/model/miaoguo.js

@@ -0,0 +1,33 @@
1
+import { query } from '../util/db.js';
2
+import { stringUtils } from '../util/stringClass.js';
3
+
4
+/**
5
+ * Miaoguo 模型
6
+ */
7
+class Miaoguo {
8
+    
9
+    static async GetLiteracyItem(obj) {
10
+        try {
11
+            if (obj.ShiciUrl) {
12
+                sql="select * from MiaoguoLiteracy where Word=? and SearchType=? and Author=? and ShiciUrl=? order by ID;";
13
+                let param=[obj.Word,obj.SearchType,obj.Author,obj.ShiciUrl];
14
+                return await query(sql, param);
15
+            }
16
+            else {
17
+                let sql = "select * from MiaoguoLiteracy where Word='"+stringUtils.ReplaceAllString(obj.Word,"'","ˈ")+"'";
18
+                if (obj.SearchType)
19
+                    sql+=" and SearchType='"+stringUtils.ReplaceAllString(obj.SearchType,"'","''")+"'";
20
+                if (obj.Author)
21
+                    sql+=" and Author='"+stringUtils.ReplaceAllString(obj.Author,"'","''")+"'";
22
+                sql+=" order by ID;";
23
+                //console.log(sql);
24
+                return await query(sql, null);
25
+            }
26
+        } catch (error) {
27
+            console.error('获取列表失败:', error);
28
+            throw error;
29
+        }
30
+    }
31
+}
32
+
33
+export default Miaoguo;

+ 4 - 3
src/test/build.test.js

@@ -1,3 +1,4 @@
1
+//通过AI生成英语单词释义或例句
1 2
 import commonModel from '../model/commonModel.js';
2 3
 import fs from 'fs';
3 4
 import { stringUtils } from '../util/stringClass.js';
@@ -16,7 +17,7 @@ async function runScript(){
16 17
 
17 18
         // 添加延时函数,确保每分钟只发送9次请求(约每6.67秒一次请求)
18 19
         const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
19
-        const requestDelay = 100;
20
+        const requestDelay = 2000;
20 21
         
21 22
         for(let i=start;i<count;i++){
22 23
             let item=list[i];
@@ -48,8 +49,8 @@ async function runScript(){
48 49
 
49 50
             let aiProvider="llama-4-maverick-17b-128e-instruct";
50 51
 
51
-            //aiProvider="ali-qwen-plus";
52
-            aiProvider="ali-deepseek-v3";
52
+            aiProvider="ali-qwen-plus-2025-07-28";
53
+            //aiProvider="ali-deepseek-v3";
53 54
 
54 55
             //生成例句
55 56
             let result = await aiController.generateArticle(content, aiProvider);

+ 4 - 4
src/test/build.test2.js

@@ -26,10 +26,10 @@ async function runScript(){
26 26
             let EnglishExplanation=item.EnglishExplanation;
27 27
             if (EnglishExplanation){
28 28
                 try{
29
-                    EnglishExplanation=JSON.parse(EnglishExplanation);
30
-                    // let sql2="update Words set EnglishExplanation=? where BookID<>110 and BookID not in (141,142,143,144,145,146,161,162,163,164,165,166,167,168) and Word='"+word+"';";
29
+                    //EnglishExplanation=JSON.parse(EnglishExplanation);
30
+                    let sql2="update Words set EnglishExplanation=? where BookID<>110 and BookID not in (141,142,143,144,145,146,161,162,163,164,165,166,167,168) and Word='"+word+"';";
31 31
                     // //console.log(sql2);
32
-                    // await commonModel.RunSql(item.ExampleSentence,sql2);
32
+                    await commonModel.RunSql(item.ExampleSentence,sql2);
33 33
                 }
34 34
                 catch(e){
35 35
                     let sql2="update Words set EnglishExplanation='' where ID="+id+";";
@@ -43,7 +43,7 @@ async function runScript(){
43 43
                 console.log( word +" 空");
44 44
                 process.exit(1);
45 45
             }
46
-            //console.log( i +"/"+ list.length);
46
+            console.log( i +"/"+ list.length);
47 47
             
48 48
             // 在每次请求后添加延时,除非是最后一个请求
49 49
             // if (i < count - 1) {

+ 65 - 40
src/test/build.test3.js

@@ -7,13 +7,13 @@ async function runScript(){
7 7
     let id,word;
8 8
     try {
9 9
         
10
-        const sql="select * from Words where BookID=110 and ExampleSentence is not null order by ID;"
10
+        const sql="select * from Words where BookID=110 and ExampleSentence<>'' order by ID;"
11 11
         let list = await commonModel.RunSql(null,sql);
12 12
         let count=list.length;
13 13
 
14 14
         const start=0;
15 15
         //const start=0;
16
-        //count=1;
16
+        //count=10;
17 17
 
18 18
         // 添加延时函数,确保每分钟只发送9次请求(约每6.67秒一次请求)
19 19
         // const delay = (ms ) => new Promise(resolve => setTimeout(resolve, ms));
@@ -25,10 +25,10 @@ async function runScript(){
25 25
             id=item.ID;
26 26
             //获得单词
27 27
             word=item.Word;
28
-            let exampleSentence=item.ExampleSentence;
29
-            if (exampleSentence){
28
+            let EnglishExplanation=item.EnglishExplanation;
29
+            if (EnglishExplanation){
30 30
                 try{
31
-                    exampleSentence=JSON.parse(exampleSentence);
31
+                    EnglishExplanation=JSON.parse(EnglishExplanation);
32 32
                     //console.log(exampleSentence);
33 33
                     let sql2="select * from MiaoguoLiteracy where Word='"+word+"';";
34 34
                     let list2= await commonModel.RunSql(null,sql2);
@@ -40,53 +40,78 @@ async function runScript(){
40 40
 
41 41
                         //console.log(json);
42 42
                         if (json.ENG 
43
-                            && json.ENG.ExamplesSentences 
44
-                            && json.ENG.ExamplesSentences.length>0 
45
-                            && json.ENG.ExamplesSentences[0][0].indexOf("[线]")<0 
43
+                            && (!json.ENG.ParaphraseEng 
44
+                            || json.ENG.ParaphraseEng.length==0)
46 45
                         ){
47
-                            console.log(id+" "+word);
48
-                            // if (json.ENG){
49
-                            //     let arrSentence=[];
50
-                                
51
-                            //     for(let k=0;k<exampleSentence.Sentences.length;k++){
52
-                            //         let obj=[];
53
-                            //         let sentence1=exampleSentence.Sentences[k].Sentence;
54
-                                    
55
-                            //         sentence1=stringUtils.ReplaceAllString(sentence1,word,"[线]"+word+"[/线]");
56
-                                    
57
-                            //         if (sentence1.substring(0,word.length).toLowerCase()==word.toLowerCase()){
58
-                            //             let word1=sentence1.substring(0,word.length);
59
-                            //             sentence1=sentence1.replace(word1,"[线]"+word1+"[/线]");
60
-                            //         }
61
-                            //         //console.log(sentence1);
46
+                            //console.log(id+" "+word);
47
+                            if (json.ENG){
48
+                                // let arrSentence=[];
49
+
50
+                                // let arrEnglishExplanation=EnglishExplanation.EnglishExplanation;
51
+                                // //console.log(id+" "+arrEnglishExplanation.length);
52
+                                // for(let k=0;k<arrEnglishExplanation.length;k++){
53
+                                //     let obj={};
54
+                                //     obj.PartOfSpeech="";
55
+                                //     obj.ParaphraseList=[];
56
+                                //     let item1=arrEnglishExplanation[k];
62 57
                                     
63
-                            //         obj.push(sentence1);
64
-                            //         obj.push(exampleSentence.Sentences[k].Translate);
65
-                            //         arrSentence.push(obj);
66
-                            //     }
67
-                            //     if (!json.ENG.ExamplesSentences)
68
-                            //         json.ENG.ExamplesSentences=[];
58
+                                //     //console.log(k+" "+item1);
59
+                                //     if (item1.indexOf(".")>0){
60
+                                //         obj.PartOfSpeech=item1.substring(0,item1.indexOf(".")+1);
61
+                                //         let str=item1.substring(item1.indexOf(".")+1);
62
+                                //         str=stringUtils.Trim(str);
63
+                                //         //console.log("str: "+str);
64
+                                //         obj.ParaphraseList.push(str);
65
+                                //         //console.log(sentence1);
66
+                                //         arrSentence.push(obj);
67
+                                //     }
68
+                                // }
69
+
70
+                                // let temp="",arrPartOfSpeech=[];
71
+                                // for(let k=0;k<arrSentence.length;k++){
72
+                                //     let item=arrSentence[k];
73
+                                //     if (temp!=item.PartOfSpeech){
74
+                                //         let obj={};
75
+                                //         obj.PartOfSpeech=item.PartOfSpeech;
76
+                                //         obj.ParaphraseList=[];
77
+                                //         arrPartOfSpeech.push(obj);
78
+                                //     }
79
+                                //     temp=item.PartOfSpeech;
80
+                                // }
81
+
82
+                                // for(let k=0;k<arrSentence.length;k++){
83
+                                //     for(let n=0;n<arrPartOfSpeech.length;n++){
84
+                                //         if (arrSentence[k].PartOfSpeech==arrPartOfSpeech[n].PartOfSpeech){
85
+                                //             arrPartOfSpeech[n].ParaphraseList.push(arrSentence[k].ParaphraseList[0]);
86
+                                //         }
87
+                                //     }
88
+                                // }
89
+
90
+                                // //console.log(arrPartOfSpeech);
69 91
                                 
70
-                            //     json.ENG.ExamplesSentences=arrSentence;
71
-                            // }
72
-                            // json.ENG.CEFR_Level=exampleSentence.CEFR_Level;
92
+                                // json.ENG.EnglishExplanation=arrPartOfSpeech;
73 93
 
74
-                            // json=JSON.stringify(json);
75
-                            // let sql3="update MiaoguoLiteracy set JSONString=? where ID="+list2[j].ID+";";
76
-                            // //console.log(sql3);
77
-                            // //console.log(json);
78
-                            // await commonModel.RunSql(json,sql3);
94
+                                json.ENG.ParaphraseEng=json.ENG.EnglishExplanation;
95
+                                delete json.ENG.EnglishExplanation;
96
+                            }
97
+                            
98
+                            json=JSON.stringify(json);
99
+                            let sql3="update MiaoguoLiteracy set JSONString=? where ID="+list2[j].ID+";";
100
+                            //console.log(sql3);
101
+                            //console.log(json);
102
+                            await commonModel.RunSql(json,sql3);
79 103
                         }
80 104
                     }
81 105
 
82 106
                 }
83 107
                 catch(e){
84
-                    let sql2="update Words set ExampleSentence='' where ID="+id+";";
108
+                    //let sql2="update Words set ExampleSentence='' where ID="+id+";";
85 109
                     console.log("出错:"+word);
86
-                    await commonModel.RunSql(item.ExampleSentence,sql2);
110
+                    process.exit(1);
111
+                    //await commonModel.RunSql(item.ExampleSentence,sql2);
87 112
                 }
88 113
             }
89
-            //console.log(i +"/"+ list.length+" "+word);
114
+            console.log(i +"/"+ list.length+" "+word);
90 115
             
91 116
             // 在每次请求后添加延时,除非是最后一个请求
92 117
             // if (i < count - 1) {

+ 88 - 70
src/test/build.test4.js

@@ -1,5 +1,6 @@
1 1
 import commonModel from '../model/commonModel.js';
2 2
 import fs from 'fs';
3
+import _ from 'lodash';
3 4
 import { stringUtils } from '../util/stringClass.js';
4 5
 import aiController from '../api/yjbdc/aiController.js';
5 6
 
@@ -7,93 +8,92 @@ async function runScript(){
7 8
     try {
8 9
         
9 10
         //按照高频单词的使用频率排序,列出所有单词
10
-        const sql="select * from Words where Word='';";
11
+        //const sql="select * from MiaoguoLiteracy where ID>0 order by ID desc;";
12
+        const sql="SELECT * FROM kylx365_db.MiaoguoLiteracy where SearchType='zici' and JSONString like '%pinyin%' and JSONString not like '%explain%' and ID>0 order by ID desc;";
13
+        
11 14
         let list = await commonModel.RunSql(null,sql);
12 15
         let count=list.length;
13 16
         console.log(count);
14 17
         const start=0;
15
-        //count=2;
16
-
17
-        // 添加延时函数,确保每分钟只发送9次请求(约每6.67秒一次请求)
18
-        const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
19
-        const requestDelay = 7000; // 7秒,确保每分钟最多9次请求
18
+        //count=100;
20 19
         
21 20
         for(let i=start;i<count;i++){
22 21
             let item=list[i];
23
-
24 22
             //获得单词
25 23
             const word=item.Word;
26 24
 
27
-            let content={
28
-                "instruction": "用单词"+word+"生成例句,中国学生学习英文使用",
29
-                "requirements": [
30
-                    "判断单词在CEFR的最低级别,比如experience是B1",
31
-                    "用单词最常用的含义生成最低级别到C1各两句例句,比如experience生成B1、B2、C1各两句",
32
-                    "单词允许类似过去式、复数等变形",
33
-                    "提供例句翻译",
34
-                    "格式要求是JSON格式,完全遵循output_format,另外生成不要有重复“\"”",
35
-                    "如果有多个方案,直接给最好的"
36
-                ],
37
-                "output_format":{
38
-                    "word":"单词",
39
-                    "CEFR_Level":"A1",
40
-                    "Sentences": [
41
-                        {
42
-                        "Sentence":"句子1",
43
-                        "Translate": "翻译1",
44
-                        "Level": "A1",
45
-                        },{
46
-                        "Sentence":"句子2",
47
-                        "Translate": "翻译2",
48
-                        "Level": "A2",
49
-                        },
50
-                    ]
51
-                }
52
-            };
53
-            content=JSON.stringify(content);
54
-            //console.log(content);
55
-
56
-            let aiProvider="llama-4-maverick-17b-128e-instruct";
25
+            const reg = new RegExp("[A-Z]");
26
+            if (word.length==1 && reg.test(word)){
27
+                console.log(word+" 跳过");
28
+                continue;
29
+            }
57 30
 
58
-            //aiProvider="ali-qwen-plus";
59
-            //生成例句
60
-            let result = await aiController.generateArticle(content, aiProvider);
31
+            let json="";
61 32
             
33
+            try{
34
+                json=JSON.parse(item.JSONString);
35
+
36
+                if (item.SearchType=='zici'){
37
+                    //console.error( item.ID +" "+ word);
38
+                    let content = {
39
+                        "instruction": "生成词语“" + word + "”的相关信息。",
40
+                        "output_format": {
41
+                            "pinyin": "拼音(空格分隔)",
42
+                            "explain": ["释义1", "释义2..."],
43
+                            "synonym": ["近义词1", "近义词2..."],
44
+                            "antonym": ["反义词1", "反义词2..."],
45
+                            "englishWord": ["word1", "word2..."]
46
+                        }
47
+                    };
48
+                    content=JSON.stringify(content);
49
+                    //console.log(content);
50
+        
51
+                    let aiProvider="llama-4-maverick-17b-128e-instruct";
52
+                    aiProvider="ali-qwen-plus-2025-07-14";
53
+                    
54
+                    //生成例句
55
+                    let result = await aiController.generateArticle(content, aiProvider);
56
+                    
57
+                    result=JSON.parse(result);
58
+                    //console.log("result1:"+result);
62 59
 
63
-            console.log("result1:"+result);
64
-            //console.log(result.indexOf("{")); 
65
-            if (result.indexOf("```json")>0){
66
-                console.log("```json");
67
-                console.log(result.indexOf("```json"));
68
-                result=result.substring(result.indexOf("```json")+7);
69
-                result=result.substring(0,result.lastIndexOf("```"));
60
+                    let obj={};
61
+                    obj.pinyin=result.pinyin;
62
+                    obj.explain=result.explain;
63
+                    json.CHN.PinYin=[];
64
+                    json.CHN.PinYin.push(obj);
65
+                    json.CHN.TianKong=tiankongFun(word,result.pinyin);
66
+                    json.CHN.Synonym=result.synonym;
67
+                    json.CHN.Antonym=result.antonym;
68
+                    //console.log("pinyin:"+result.pinyin);
69
+                    //console.log("synonym:"+result.synonym);
70
+                    
71
+                    let eng={};
72
+                    eng.Word=word;
73
+                    eng.Paraphrase={
74
+                        PartOfSpeech:"",
75
+                        ParaphraseList:result.englishWord.join(","),
76
+                    }
77
+                    json.ENG=eng;
78
+                    
79
+                    json=JSON.stringify(json);
80
+                    let sql3="update MiaoguoLiteracy set JSONString=? where ID="+item.ID+";";
81
+                    //console.log(sql3);
82
+                    //console.log(json);
83
+                    await commonModel.RunSql(json,sql3);
84
+                    
85
+                }
70 86
             }
71
-            else if (result.indexOf("```")>0){
72
-                console.log("```");
73
-                console.log(result.indexOf("```"));
74
-                
75
-                result=result.substring(result.indexOf("```")+3);
76
-                result=result.substring(0,result.lastIndexOf("```"));
87
+            catch(e){
88
+                console.error("error:"+ item.ID +" "+ word +" " + e);
89
+                let sql3="delete from MiaoguoLiteracy where ID="+item.ID+";";
90
+                await commonModel.RunSql(null,sql3);
91
+                //process.exit(1);
77 92
             }
78
-            console.log("result2:"+result); 
79
-
80
-            result=result.replace("\"\": ","\": ");
81
-            result=result.replace("\"\":","\":");
82
-            result=result.replace(":\"\"",":\"");
83
-            result=result.replace(": \"\"",": \"");
84
-            result=result.replace(",\"\"",",\"");
85
-            result=result.replace("\"\",","\",");
86
-
87
-            let sql2="update Words set ExampleSentence=? where ID="+item.ID+";";
88
-            await commonModel.RunSql(result,sql2);
93
+            //console.log(content);
89 94
             
90
-            console.log( i +"/"+ list.length+" "+word);
95
+            console.log( i +"/"+ list.length+" "+ item.ID +" "+ word);
91 96
             
92
-            // 在每次请求后添加延时,除非是最后一个请求
93
-            if (i < count - 1) {
94
-                console.log(`等待 ${requestDelay/1000} 秒后继续下一个请求...`);
95
-                await delay(requestDelay);
96
-            }
97 97
         }
98 98
         
99 99
         console.log("完成");
@@ -108,3 +108,21 @@ async function runScript(){
108 108
 runScript().catch(error => {
109 109
     console.error('Error in runScript:', error);
110 110
 });
111
+
112
+// let a=tiankongFun("时事","shí shì");
113
+// console.log(a);
114
+function tiankongFun(word,pinyin){
115
+    let TianKong = [];
116
+    if (word.length <= 4 && pinyin ) {
117
+        
118
+        var arrPinyin = pinyin.split(" ");
119
+        //console.log(arrPinyin);
120
+        for (var i = 0; i < word.length; i++) {
121
+            var str = stringUtils.ReplaceAllString(word,word[i],arrPinyin[i]);
122
+            //var str=param.Word.substring(0,i)+arrPinyin[i]+param.Word.substring(i+1);
123
+            TianKong.push(str);
124
+        }
125
+        TianKong= _.uniq(TianKong);
126
+    }
127
+    return TianKong;
128
+}

+ 57 - 0
src/test/build.test41.js

@@ -0,0 +1,57 @@
1
+import commonModel from '../model/commonModel.js';
2
+import fs from 'fs';
3
+import _ from 'lodash';
4
+import { stringUtils } from '../util/stringClass.js';
5
+import aiController from '../api/yjbdc/aiController.js';
6
+
7
+async function runScript(){
8
+    try {
9
+        
10
+        //按照高频单词的使用频率排序,列出所有单词
11
+        //const sql="select * from MiaoguoLiteracy where ID>0 order by ID desc;";
12
+        const sql="SELECT a.ID,b.ID as 'ID2' FROM MiaoguoLiteracy a inner join MiaoguoLiteracy b on a.ID<b.ID and a.Word=b.Word and a.SearchType=b.SearchType  where a.SearchType='eng' order by a.ID;";
13
+        
14
+        let list = await commonModel.RunSql(null,sql);
15
+        let count=list.length;
16
+        console.log(count);
17
+        const start=0;
18
+        //count=100;
19
+        
20
+        for(let i=start;i<count;i++){
21
+            let item=list[i];
22
+            let sql3="delete from MiaoguoLiteracy where ID="+item.ID2+";";
23
+            //console.log(sql3);
24
+            await commonModel.RunSql(null,sql3);
25
+            console.log( i +"/"+ list.length+" "+ item.ID);
26
+        }
27
+        
28
+        console.log("完成");
29
+        process.exit(1);
30
+    } catch (error) {
31
+        console.error('Error executing script:', error);
32
+        process.exit(1);
33
+    }
34
+}
35
+
36
+// 处理Promise并添加错误捕获
37
+runScript().catch(error => {
38
+    console.error('Error in runScript:', error);
39
+});
40
+
41
+// let a=tiankongFun("时事","shí shì");
42
+// console.log(a);
43
+function tiankongFun(word,pinyin){
44
+    let TianKong = [];
45
+    if (word.length <= 4 && pinyin ) {
46
+        
47
+        var arrPinyin = pinyin.split(" ");
48
+        //console.log(arrPinyin);
49
+        for (var i = 0; i < word.length; i++) {
50
+            var str = stringUtils.ReplaceAllString(word,word[i],arrPinyin[i]);
51
+            //var str=param.Word.substring(0,i)+arrPinyin[i]+param.Word.substring(i+1);
52
+            TianKong.push(str);
53
+        }
54
+        TianKong= _.uniq(TianKong);
55
+    }
56
+    return TianKong;
57
+}

+ 17 - 9
src/test/build.人教版单词.js

@@ -1,6 +1,7 @@
1 1
 import commonModel from '../model/commonModel.js';
2 2
 import { stringUtils } from '../util/stringClass.js';
3 3
 import fs from 'fs';
4
+import _ from 'lodash';
4 5
 
5 6
 async function runScript(){
6 7
     try {
@@ -8,18 +9,20 @@ async function runScript(){
8 9
         let arr=data.split("\n")
9 10
 
10 11
 
11
-        for(var i=0;i<arr.length;i++){
12
-            if (arr[i].indexOf("/")<0){
13
-                arr[i]=arr[i].replace("\t","\t\t");
14
-            }
15
-        }
16
-
12
+        // for(var i=0;i<arr.length;i++){
13
+        //     arr[i]=stringUtils.ReplaceAllString(arr[i],"\t","\t");
14
+        //     //console.log(arr[i]);
15
+        // }
16
+        const BOOK_ID=191;
17
+        let count=0;
17 18
         for(var i=0;i<arr.length;i++){
18 19
             var item=arr[i].split("\t");
20
+            item = item.filter(item2 => item2 && item2.trim() !== '');
21
+            //console.log(item.join("\t"));
19 22
             if (item[0]){
20 23
                 let obj={};
21 24
                 obj.Word=stringUtils.Trim(stringUtils.ReplaceAllString(item[0],"'","ˈ"));
22
-                obj.Word=obj.Word.replace("*","");
25
+                //obj.Word=obj.Word.replace("*","");
23 26
                 
24 27
                 if (item[1]){
25 28
                     obj.Soundmark="["+stringUtils.Trim(stringUtils.ReplaceAllString(item[1],"/",""))+"]";
@@ -28,16 +31,21 @@ async function runScript(){
28 31
                 }
29 32
                     
30 33
                 obj.Translate=stringUtils.Trim(item[2]);
31
-                obj.BookID=211;
34
+                obj.BookID=BOOK_ID;
32 35
                 obj.LessonID=stringUtils.Trim(item[3].replace("Unit",""));
36
+                obj.LessonID=obj.LessonID.replace(" |","");
33 37
                 obj.LessonName="Unit "+obj.LessonID;
34 38
                 console.log(JSON.stringify(obj));
35 39
 
36 40
                 const sql = "INSERT INTO Words SET ?";
37 41
                 await commonModel.RunSql(obj,sql);
38
-                
42
+                count++;
39 43
             }
40 44
         }
45
+
46
+        const sql2 = "UPDATE MiaoguoBook SET WordNum="+count+" Where BookIDOld="+BOOK_ID;
47
+        await commonModel.RunSql(null,sql2);
48
+
41 49
         console.log("完成");
42 50
         process.exit(1);
43 51
     } catch (error) {

+ 12 - 1
src/test/build.人教版常用表达法.js

@@ -4,8 +4,11 @@ import fs from 'fs';
4 4
 
5 5
 async function runScript(){
6 6
     try {
7
+        const BOOK_ID=203;
8
+
7 9
         var data = fs.readFileSync('data2.txt', 'utf8');
8 10
         let arr=data.split("\n")
11
+        let count=0;
9 12
         for(var i=0;i<arr.length;i++){
10 13
             var item=arr[i].split("|");
11 14
             if (item[1]){
@@ -14,15 +17,23 @@ async function runScript(){
14 17
                 obj.Word=stringUtils.ReplaceAllString(obj.Word,"'","ˈ");
15 18
                 obj.Translate=stringUtils.Trim(item[2]);
16 19
                 obj.Translate=stringUtils.ReplaceAllString(obj.Translate,"'","ˈ");
17
-                obj.BookID=206;
20
+                obj.BookID=BOOK_ID;
18 21
                 obj.LessonID=stringUtils.Trim(item[3].replace("Unit",""));
22
+                obj.LessonName="Unit "+obj.LessonID;
19 23
                 console.log(JSON.stringify(obj));
20 24
 
21 25
                 const sql = "INSERT INTO Words SET ?";
22 26
                 await commonModel.RunSql(obj,sql);
27
+
28
+                count++;
23 29
                 
24 30
             }
25 31
         }
32
+
33
+        const sql2 = "UPDATE MiaoguoBook SET WordNum="+count+" Where BookIDOld="+BOOK_ID+";";
34
+        console.log(sql2);
35
+        await commonModel.RunSql(null,sql2);
36
+
26 37
         console.log("完成");
27 38
         process.exit(1);
28 39
     } catch (error) {

+ 25 - 14
src/test/build.古诗文背诵.js

@@ -46,7 +46,7 @@ async function runScript() {
46 46
         .poem-title {
47 47
             font-size: 32px;
48 48
             font-weight: bold;
49
-            margin: 0 0 20px 0;
49
+            margin: 50px 0 20px 0;
50 50
             text-align: center;
51 51
             color: #8b4513;
52 52
             text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
@@ -73,11 +73,19 @@ async function runScript() {
73 73
             max-width: 80%;
74 74
         }
75 75
         .tag {
76
-            font-size: 12px;
76
+            font-size: 16px;
77
+            color: #999;
78
+            position: absolute;
79
+            top: 20px;
80
+            left: 20px;
81
+            text-align: left;
82
+        }
83
+        .tag2 {
84
+            font-size: 9px;
77 85
             color: #999;
78 86
             position: absolute;
79
-            bottom: 20px;
80 87
             right: 20px;
88
+            bottom: 20px;
81 89
             text-align: right;
82 90
         }
83 91
     </style>
@@ -138,11 +146,9 @@ async function runScript() {
138 146
             // 同年级按学期排序(上在前)
139 147
             return termA === '上' ? -1 : 1;
140 148
         });
141
-// ... existing code ...
142
-
143 149
 
144 150
         // 确保排序后的键符合预期顺序
145
-        console.log('Sorted Keys:', sortedKeys);
151
+        //console.log('Sorted Keys:', sortedKeys);
146 152
 
147 153
         for (const key of sortedKeys) {
148 154
             const gradeMatches = groupedByGradeAndTerm[key];
@@ -153,19 +159,21 @@ async function runScript() {
153 159
 
154 160
             // 处理诗词
155 161
             for (const match of poems) {
156
-                const tag = match[1];
162
+                let tag = match[1];
163
+                tag=stringUtils.ReplaceAllString(tag,",","·");
164
+                
157 165
                 const title = match[2];
158 166
                 const author = match[3] === 'NULL' ? '' : match[3];
159 167
                 const dynasty = match[4] === 'NULL' ? '' : match[4].replace(/\\[|\\]/g, '');
160 168
 
161 169
                 let poemContent = match[5];
162 170
                 const poemMatches = poemContent.match(/\"([^\"]+)\"/g) || [];
163
-                const cleanedPoem = poemMatches.map(line => line.replace(/\"/g, '')).join('<br>');
171
+                const cleanedPoem = poemMatches.map(line => line.replace(/\"/g, '').replace(/,/g, '<span style="white-space: nowrap;">,</span>')).join('<br>');
164 172
 
165 173
                 let translation = match[6];
166 174
                 const translationMatches = translation.match(/\"([^\"]+)\"/g) || [];
167
-                const cleanedTranslation = translationMatches.map(line => line.replace(/\"/g, '')).join('<br>');
168
-
175
+                // 如果译文内容较长,则不使用<br>标签,让文本自然换行
176
+                const cleanedTranslation = translationMatches.map(line => line.replace(/\"/g, '')).join(translation.length > 300 ? ' ' : '');
169 177
                 const formattedTitle = title.replace(/([。]|(?<!——)\s+)(?!——)\s*/g, '$1<br>');
170 178
 
171 179
                 htmlContent += `
@@ -175,24 +183,26 @@ async function runScript() {
175 183
         <div class="poem-content">${cleanedPoem}</div>
176 184
         <div class="poem-translation">${cleanedTranslation}</div>
177 185
         <div class="tag">${tag}</div>
186
+        <div class="tag2">微信小程序:秒过·错题记忆卡 出品</div>
178 187
     </div>`;
179 188
             }
180 189
 
181 190
             // 处理日积月累
182 191
             for (const match of accumulations) {
183
-                const tag = match[1];
192
+                let tag = match[1];
193
+                tag=stringUtils.ReplaceAllString(tag,",","·");
184 194
                 const title = match[2];
185 195
                 const author = match[3] === 'NULL' ? '' : match[3];
186 196
                 const dynasty = match[4] === 'NULL' ? '' : match[4].replace(/\\[|\\]/g, '');
187 197
 
188 198
                 let poemContent = match[5];
189 199
                 const poemMatches = poemContent.match(/\"([^\"]+)\"/g) || [];
190
-                const cleanedPoem = poemMatches.map(line => line.replace(/\"/g, '')).join('<br>');
200
+                const cleanedPoem = poemMatches.map(line => line.replace(/\"/g, '').replace(/,/g, '<span style="white-space: nowrap;">,</span>')).join('<br>');
191 201
 
192 202
                 let translation = match[6];
193 203
                 const translationMatches = translation.match(/\"([^\"]+)\"/g) || [];
194
-                const cleanedTranslation = translationMatches.map(line => line.replace(/\"/g, '')).join('<br>');
195
-
204
+                // 如果译文内容较长,则不使用<br>标签,让文本自然换行
205
+                const cleanedTranslation = translationMatches.map(line => line.replace(/\"/g, '')).join(translation.length > 300 ? ' ' : '');
196 206
                 const formattedTitle = title.replace(/([。]|(?<!——)\s+)(?!——)\s*/g, '$1<br>');
197 207
 
198 208
                 htmlContent += `
@@ -202,6 +212,7 @@ async function runScript() {
202 212
         <div class="poem-content">${cleanedPoem}</div>
203 213
         <div class="poem-translation">${cleanedTranslation}</div>
204 214
         <div class="tag">${tag}</div>
215
+        <div class="tag2">微信小程序:秒过·错题记忆卡 出品</div>
205 216
     </div>`;
206 217
             }
207 218
         }

+ 118 - 0
src/test/data.txt

@@ -0,0 +1,118 @@
1
+team	/tiːm/	(游戏或运动的)队;(一起工作的)组,班	Unit 1
2
+player	/ˈpleɪə(r)/	运动员;参赛选手	Unit 1
3
+him	/hɪm/	他	Unit 1
4
+lovely	/ˈlʌvli/	美丽的;优美的	Unit 1
5
+clever	/ˈklevə(r)/	聪明的;聪颖的	Unit 1
6
+young	/jʌŋ/	幼小的;年轻的	Unit 1
7
+hard-working	/hɑːd ˈwɜːkɪŋ/	工作努力的;辛勤的	Unit 1
8
+science	/ˈsaɪəns/	科学;自然科学	Unit 1
9
+robot	/ˈrəʊbɒt/	机器人	Unit 1
10
+jump	/dʒʌmp/	跳;跃	Unit 1
11
+rope	/rəʊp/	绳;粗绳	Unit 1
12
+piano	/pɪˈænəʊ/	钢琴	Unit 1
13
+chess	/tʃes/	国际象棋	Unit 1
14
+front	/frʌnt/	前部	Unit 1
15
+easy	/ˈiːzi/	容易的;轻易的	Unit 1
16
+star	/stɑː(r)/	歌唱(或表演)明星	Unit 1
17
+wonderful	/ˈwʌndəfl/	精彩的;绝妙的	Unit 1
18
+Australia	/ɒˈstreɪliə/	澳大利亚	Unit 1
19
+sad	/sæd/	悲哀的;难过的	Unit 2
20
+matter	/ˈmætə(r)/	事情;问题	Unit 2
21
+project	/ˈprɒdʒekt/	项目;方案	Unit 2
22
+centre	/ˈsentə(r)/	中心	Unit 2
23
+agree	/əˈɡriː/	同意;赞成	Unit 2
24
+finish	/ˈfɪnɪʃ/	完成;做好	Unit 2
25
+Monday	/ˈmʌndeɪ/	星期一	Unit 2
26
+worried	/ˈwʌrid/	担心的;担忧的	Unit 2
27
+both	/bəʊθ/	两者	Unit 2
28
+excited	/ɪkˈsaɪtɪd/	激动的;兴奋的	Unit 2
29
+wrong	/rɒŋ/	错误的	Unit 2
30
+angry	/ˈæŋɡri/	愤怒的;生气的	Unit 2
31
+afraid	/əˈfreɪd/	担心;害怕	Unit 2
32
+parent	/ˈpeərənt/	父亲;母亲	Unit 2
33
+ask	/ɑːsk/	问;询问	Unit 2
34
+move	/muːv/	搬家;移动	Unit 2
35
+yours	/jɔːz/	您的(用于书信结尾的签名前)	Unit 2
36
+Wednesday	/ˈwenzdeɪ/	星期三	Unit 3
37
+subject	/ˈsʌbdʒɪkt/	科目;学科	Unit 3
38
+Tuesday	/ˈtjuːzdeɪ/	星期二	Unit 3
39
+Friday	/ˈfraɪdeɪ/	星期五	Unit 3
40
+because	/bɪˈkɒz/	因为	Unit 3
41
+Monday	/ˈmʌndeɪ/	星期一	Unit 3
42
+Thursday	/ˈθɜːzdeɪ/	星期四	Unit 3
43
+start	/stɑːt/	开始	Unit 3
44
+usually	/ˈjuːʒuəli/	通常地;经常地	Unit 3
45
+weekend	/ˌwiːkˈend/	周末	Unit 3
46
+sometimes	/ˈsʌmtaɪmz/	有时;间或	Unit 3
47
+Saturday	/ˈsætədeɪ/	星期六	Unit 3
48
+Sunday	/ˈsʌndeɪ/	星期日	Unit 3
49
+lesson	/ˈlesn/	课;一节课	Unit 3
50
+evening	/ˈiːvnɪŋ/	晚上;傍晚	Unit 3
51
+answer	/ˈɑːnsə(r)/	答复;回答	Unit 3
52
+ping-pong	/ˈpɪŋ pɒŋ/	乒乓球	Unit 3
53
+night	/naɪt/	夜;夜晚	Unit 3
54
+visit	/ˈvɪzɪt/	看望;拜访;参观	Unit 3
55
+grandparent	/ˈɡrænpeərənt/	祖父;祖母;外祖父;外祖母	Unit 3
56
+stay	/steɪ/	待;保持;继续是	Unit 4
57
+should	/ʃʊd/	(提出或征询建议)该,可以	Unit 4
58
+flu	/fluː/	流行性感冒;流感	Unit 4
59
+else	/els/	其他的;别的	Unit 4
60
+exercise	/ˈeksəsaɪz/	锻炼;训练;操练	Unit 4
61
+enough	/ɪˈnʌf/	足够的;充足的;充分的	Unit 4
62
+if	/ɪf/	如果;假若;倘若	Unit 4
63
+habit	/ˈhæbɪt/	习惯	Unit 4
64
+show	/ʃəʊ/	(电视或广播)节目	Unit 4
65
+phone	/fəʊn/	电话;电话机	Unit 4
66
+then	/ðen/	那么;因此;既然如此	Unit 4
67
+rest	/rest/	休息;放松	Unit 4
68
+take care of	/teɪk keə(r) ɒv/	爱护;照顾	Unit 4
69
+check	/tʃek/	查看;查明	Unit 4
70
+less	/les/	较少的,更少的	Unit 4
71
+brush	/brʌʃ/	(用刷子)刷净,刷亮,刷平顺	Unit 4
72
+tooth	/tuːθ/	牙;齿	Unit 4
73
+twice	/twaɪs/	两次;两遍	Unit 4
74
+hour	/ˈaʊə(r)/	小时	Unit 4
75
+free	/friː/	没有安排活动的;空闲的	Unit 4
76
+hungry	/ˈhʌŋɡri/	感到饿的	Unit 5
77
+beef	/biːf/	牛肉	Unit 5
78
+ice cream	/aɪs kriːm/	(一份)冰激凌	Unit 5
79
+little	/ˈlɪtl/	少许;一点	Unit 5
80
+dumpling	/ˈdʌmplɪŋ/	饺子;汤圆	Unit 5
81
+tea	/tiː/	茶叶;茶;茶水	Unit 5
82
+hamburger	/ˈhæmbɜːɡə(r)/	汉堡包;汉堡牛肉饼	Unit 5
83
+Mrs	/ˈmɪsɪz/	(用于女子的姓氏或姓名前)太太,夫人	Unit 5
84
+coconut	/ˈkəʊkənʌt/	椰子	Unit 5
85
+interesting	/ˈɪntrəstɪŋ/	有趣的;有吸引力的	Unit 5
86
+seed	/siːd/	种子;籽	Unit 5
87
+pull	/pʊl/	拔出;抽出	Unit 5
88
+stem	/stem/	(花草的)茎;梗,柄	Unit 5
89
+root	/ruːt/	根;根茎	Unit 5
90
+lotus	/ˈləʊtəs/	莲属植物	Unit 5
91
+lake	/leɪk/	湖;湖泊	Unit 5
92
+world	/wɜːld/	世界;地球;天下	Unit 5
93
+round	/raʊnd/	圆形的;环形的;球形的	Unit 5
94
+different	/ˈdɪfrənt/	不同的;有区别的;有差异的	Unit 5
95
+way	/weɪ/	方法;手段;途径;方式	Unit 5
96
+river	/ˈrɪvə(r)/	河;江	Unit 6
97
+nature	/ˈneɪtʃə(r)/	自然界;大自然	Unit 6
98
+waterfall	/ˈwɔːtəfɔːl/	瀑布	Unit 6
99
+forest	/ˈfɒrɪst/	森林;林区	Unit 6
100
+famous	/ˈfeɪməs/	著名的;出名的	Unit 6
101
+mountain	/ˈmaʊntən/	高山;山岳	Unit 6
102
+wind	/wɪnd/	风;气流	Unit 6
103
+trip	/trɪp/	(尤指短程往返的)旅行,旅游,出行	Unit 6
104
+dangerous	/ˈdeɪndʒərəs/	有危险的;不安全的	Unit 6
105
+heavy	/ˈhevi/	程度大的;严重的	Unit 6
106
+hotel	/həʊˈtel/	旅馆;旅社	Unit 6
107
+close	/kləʊz/	关;关闭;闭上	Unit 6
108
+umbrella	/ʌmˈbrelə/	伞;雨伞	Unit 6
109
+raincoat	/ˈreɪnkəʊt/	雨衣	Unit 6
110
+worry	/ˈwʌri/	担心;担忧;发愁	Unit 6
111
+fine	/faɪn/	晴朗的	Unit 6
112
+fog	/fɒɡ/	雾	Unit 6
113
+flood	/flʌd/	洪水;水灾	Unit 6
114
+fire	/ˈfaɪə(r)/	火;火灾	Unit 6
115
+know	/nəʊ/	知道;了解	Unit 6
116
+before	/bɪˈfɔː(r)/	在……之前	Unit 6
117
+go hiking	/ɡəʊ ˈhaɪkɪŋ/	徒步旅行	Unit 6
118
+bring	/brɪŋ/	带……到某处;带来;取来	Unit 6

+ 36 - 37
src/test/data2.txt

@@ -1,37 +1,36 @@
1
-| That's the tallest dinosaur in this hall. | 那是这个厅里最高的恐龙。 | Unit1 |
2
-| It's taller than both of us together. | 它比我俩加起来还高。 | Unit1 |
3
-| How tall are you? | 你有多高? | Unit1 |
4
-| I'm 1.65 metres. | 我身高1.65米。 | Unit1 |
5
-| What size are your shoes, Mike? | 迈克,你穿多大号的鞋? | Unit1 |
6
-| Your feet are bigger than mine. My shoes are size 37. | 你的脚比我的大。我穿37号的鞋。 | Unit1 |
7
-| How heavy are you? | 你体重多少? | Unit1 |
8
-| I'm 48 kilograms. | 我体重48公斤。 | Unit1 |
9
-| How was your weekend? | 你周末过得怎么样? | Unit2 |
10
-| It was good, thank you. | 很好,谢谢。 | Unit2 |
11
-| What did you do? | 你(周末)干什么了? | Unit2 |
12
-| I stayed at home with your grandma. We drank tea in the afternoon and watched TV. | 我和你外婆待在家里。我们喝了下午茶,还看了电视。 | Unit2 |
13
-| Did you do anything else? | 你还做了其他什么事吗? | Unit2 |
14
-| Yes, I cleaned my room and washed my clothes. | 是的,我打扫了房间,还洗了衣服。 | Unit2 |
15
-| I want to buy the new film magazine. | 我想买期新的电影杂志。 | Unit2 |
16
-| What did you do last weekend? Did you see a film? | 你上周末干什么了?你看电影了吗? | Unit2 |
17
-| No, I had a cold. I stayed at home all weekend and slept. | 没有,我感冒了。整个周末都待在家里睡觉。 | Unit2 |
18
-| What happened? | 怎么了? | Unit3 |
19
-| Are you all right? | 你还好吧? | Unit3 |
20
-| I'm OK now. | 我现在没事了。 | Unit3 |
21
-| Where did you go? | 你去哪儿了? | Unit3 |
22
-| It looks like a mule! | 它看起来像头骡子! | Unit3 |
23
-| Did you go to Turpan? | 你们去吐鲁番了吗? | Unit3 |
24
-| Yes, we did. | 是的,去了。 | Unit3 |
25
-| How did you go there? | 你们怎么去的? | Unit3 |
26
-| We went there by plane. | 我们坐飞机去的。 | Unit3 |
27
-| Sounds great! | 听上去不错! | Unit3 |
28
-| There was no library in my old school. | 我以前的学校里没有图书馆。 | Unit4 |
29
-| Tell us about your school, please. | 请给我们讲讲您的学校吧。 | Unit4 |
30
-| How do you know that? | 你怎么知道的? | Unit4 |
31
-| There were no computers or Internet in my time. | 我那时候没有电脑也没有网络。 | Unit4 |
32
-| Before, I was quiet. Now, I'm very active in class. | 以前我很安静。现在我在课堂上很活跃。 | Unit4 |
33
-| I was short, so I couldn't ride my bike well. Now, I go cycling every day. | 我以前个子小,自行车骑得不好。现在我天天骑车。 | Unit4 |
34
-| Less is more. | 少即是多。 | Unit1 |
35
-| All work and no play makes Jack a dull boy. | 只工作不玩耍,聪明杰克也变傻。 | Unit2 |
36
-| All's well that ends well. | 结果好,一切都好。 | Unit3 |
37
-| Life is what you make it. | 生活是自己创造出来的。 | Unit4 |
1
+| What's he like?                                                       | 他什么样?              | Unit1 |
2
+| He's tall and strong.                                                 | 他又高又壮。             | Unit1 |
3
+| Is he good at football?                                               | 他擅长踢足球吗?           | Unit1 |
4
+| Yes, I think he is.                                                   | 是的,我想他擅长。          | Unit1 |
5
+| What can you do for the festival?                                     | 你能为科学艺术节做什么?       | Unit1 |
6
+| I can make a robot.                                                   | 我能制作机器人。           | Unit1 |
7
+| Can you make robots, Sarah?                                           | 萨拉,你能做机器人吗?        | Unit1 |
8
+| No, I can't.                                                          | 不,我不能。             | Unit1 |
9
+| Hi, Mike. You look sad. What's the matter?                            | 嗨,迈克。你看起来不开心。怎么回事? | Unit2 |
10
+| It's about our school project.                                        | 是关于我们学校的项目。        | Unit2 |
11
+| So you don't agree with each other?                                   | 所以你俩意见不一致?         | Unit2 |
12
+| Why not do both?                                                      | 为什么不两个活动都做呢?       | Unit2 |
13
+| It's important to listen to each other.                               | 听取彼此的想法很重要。        | Unit2 |
14
+| Yes, Miss White. I need to talk to Mike.                              | 是的,怀特老师。我需要和迈克谈谈。  | Unit2 |
15
+| What do you have on Wednesdays?                                       | 星期三你有什么课?          | Unit3 |
16
+| I have Chinese, maths, music and PE.                                  | 我有语文课、数学课、音乐课和体育课。 | Unit3 |
17
+| What do you usually do at the weekend, children?                      | 孩子们,周末你们通常做什么?     | Unit3 |
18
+| I often play football. Sometimes I play Chinese chess with my father. | 我经常踢足球。有时我和爸爸下象棋。  | Unit3 |
19
+| Does your mother work on Saturdays and Sundays?                       | 你妈妈周六周日都工作吗?       | Unit3 |
20
+| Yes, she does.                                                        | 是的,她(周末两天)都工作。     | Unit3 |
21
+| How can we all stay healthy?                                          | 我们怎样才能保持健康?        | Unit4 |
22
+| We should eat healthy food.                                           | 我们应该吃健康的食物。        | Unit4 |
23
+| Can I play on Mum's phone?                                            | 我可以玩玩妈妈的手机吗?       | Unit4 |
24
+| No. You shouldn't play on a phone so often.                           | 不行。你不应总是玩手机。       | Unit4 |
25
+| What would you like to eat?                                           | 你想吃些什么?            | Unit5 |
26
+| I'd like beef and rice.                                               | 我想吃牛肉和米饭。          | Unit5 |
27
+| Would you like some chicken soup too?                                 | 你还想喝鸡汤吗?           | Unit5 |
28
+| Yes, please.                                                          | 是的,请(给我鸡汤)。        | Unit5 |
29
+| Where does your coconut come from?                                    | 你的椰子是哪里的?          | Unit5 |
30
+| Hainan!                                                               | 海南!                | Unit5 |
31
+| There are also many rivers in the nature park.                        | 这个自然公园还有许多河流。      | Unit6 |
32
+| Is there a waterfall in the forest?                                   | 森林里有瀑布吗?           | Unit6 |
33
+| Yes, there is.                                                        | 是的,这里有。            | Unit6 |
34
+| Are there any famous mountains in the nature park?                    | 自然公园有名山吗?          | Unit6 |
35
+| Yes, there are.                                                       | 是的,这里有。            | Unit6 |
36
+| There will be heavy rain in the afternoon too.                        | 今天下午还将有大雨。         | Unit6 |

文件差异内容过多而无法显示
+ 2494 - 0
src/test/古诗词.html


+ 1 - 1
src/util/constant/index.js

@@ -36,7 +36,7 @@ export default {
36 36
             {Version:"zkk2",BuildSecond:30,Model:"doubao-kimi-k2-250711",Content:"字节kimi_k2\n平均30秒生成",CSS:""},
37 37
             
38 38
             {Version:"akm",BuildSecond:30,Model:"ali-Moonshot-Kimi-K2-Instruct",Content:"阿里KimiK2\n平均30秒生成",CSS:""},
39
-            {Version:"qwp",BuildSecond:30,Model:"ali-qwen-plus-2025-07-28",Content:"阿里千问plus\n平均30秒生成",CSS:""},
39
+            {Version:"qwp",BuildSecond:30,Model:"ali-qwen-plus-2025-07-14",Content:"阿里千问plus\n平均30秒生成",CSS:""},
40 40
             {Version:"qwm",BuildSecond:45,Model:"ali-qwen-max",Content:"阿里千问Max\n平均45秒生成",CSS:""},
41 41
             {Version:"lm4m",BuildSecond:15,Model:"llama-4-maverick-17b-128e-instruct",Content:"阿里脸书llama4maverick\n平均20秒生成",CSS:""},
42 42
             {Version:"lm4s",BuildSecond:20,Model:"llama-4-scout-17b-16e-instruct",Content:"阿里脸书llama4Scout\n平均15秒生成",CSS:""},

+ 1 - 1
src/util/stringClass.js

@@ -795,7 +795,7 @@ export const stringUtils = {
795 795
     },
796 796
     //判断是否是英文
797 797
     IsEnglish: (temp) => {
798
-        const reg = new RegExp("[A-Za-z]+");
798
+        const reg = new RegExp("^[A-Za-z]+(?:['-][A-Za-z]+)*$");
799 799
         return reg.test(temp);     /*进行验证*/
800 800
     },
801 801
     //循环熔断函数