|
|
@@ -94,7 +94,7 @@ export async function GetMiaoguoAISearch(ctx) {
|
|
94
|
94
|
result=JSON.parse(literacyItem[0].JSONString);
|
|
95
|
95
|
//console.log("3:"+moment().format("mm:ss"));
|
|
96
|
96
|
//查找英语词频
|
|
97
|
|
- if (!stringUtils.IsChineseSentence(param.Word)){
|
|
|
97
|
+ if (!stringUtils.HasChinese(param.Word)){
|
|
98
|
98
|
param.Word=stringUtils.ReplaceAllString(param.Word,"'","ˈ");
|
|
99
|
99
|
let sql ="select FinallyNum from WordFrequency where Word='"+param.Word+"';";
|
|
100
|
100
|
//console.log(sql);
|
|
|
@@ -120,7 +120,7 @@ export async function GetMiaoguoAISearch(ctx) {
|
|
120
|
120
|
result.ENG.Book=arrTemp;
|
|
121
|
121
|
}
|
|
122
|
122
|
//单个汉字,查找是否在人教版中
|
|
123
|
|
- if (stringUtils.IsChineseSentence(param.Word) && param.Word.length==1){
|
|
|
123
|
+ if (stringUtils.HasChinese(param.Word) && param.Word.length==1){
|
|
124
|
124
|
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;";
|
|
125
|
125
|
//console.log(sql);
|
|
126
|
126
|
let list=await commonModel.RunSql({},sql);
|
|
|
@@ -233,7 +233,7 @@ export async function GetMiaoguoAISearch(ctx) {
|
|
233
|
233
|
|
|
234
|
234
|
}
|
|
235
|
235
|
//整句中是否有中文
|
|
236
|
|
- else if ((stringUtils.IsChineseSentence(param.Word)) && param.SearchType!="eng") {
|
|
|
236
|
+ else if ((stringUtils.HasChinese(param.Word)) && param.SearchType!="eng") {
|
|
237
|
237
|
|
|
238
|
238
|
//判断是否都是中文
|
|
239
|
239
|
if (stringUtils.IsChinese(param.Word)){
|
|
|
@@ -289,7 +289,7 @@ export async function GetMiaoguoAISearch(ctx) {
|
|
289
|
289
|
}
|
|
290
|
290
|
|
|
291
|
291
|
//判断是否有公式
|
|
292
|
|
- if (stringUtils.IsChineseSentence(param.Word) && param.Word.length>=2 && param.SearchType!="zici") {
|
|
|
292
|
+ if (stringUtils.HasChinese(param.Word) && param.Word.length>=2 && param.SearchType!="zici") {
|
|
293
|
293
|
|
|
294
|
294
|
if (param.SearchType=="latex"){
|
|
295
|
295
|
let sql="SELECT * FROM kylx365_db.LatexTable where Name = '"+param.Word+"';";
|
|
|
@@ -362,7 +362,7 @@ export async function GetMiaoguoAISearch(ctx) {
|
|
362
|
362
|
}
|
|
363
|
363
|
}
|
|
364
|
364
|
}
|
|
365
|
|
-
|
|
|
365
|
+
|
|
366
|
366
|
globalCache.set(cacheKey, result, config.BufferMemoryTimeHigh);
|
|
367
|
367
|
console.log("缓存");
|
|
368
|
368
|
}
|
|
|
@@ -391,6 +391,7 @@ function getWordFrequency(id){
|
|
391
|
391
|
let num=Math.floor(id/1000)*1000;
|
|
392
|
392
|
result={Min:num,Max:Number(num+1000)};
|
|
393
|
393
|
}
|
|
|
394
|
+
|
|
394
|
395
|
return result;
|
|
395
|
396
|
}
|
|
396
|
397
|
|