|
@@ -287,8 +287,7 @@
|
|
// let pinyin = res.single;
|
|
// let pinyin = res.single;
|
|
// console.warn("****pinyin***", pinyin)
|
|
// console.warn("****pinyin***", pinyin)
|
|
// text = pinyin;
|
|
// text = pinyin;
|
|
- //全匹配轮一遍
|
|
|
|
- text = this.convertChineseToArabic(text);
|
|
|
|
|
|
+ text = this.convertChineseToArabic(text); //中文数字转为阿拉伯数字
|
|
let houseIndex = this.backwardNumber(text);//获取文字里面的数字 倒数第三个 类似这样的
|
|
let houseIndex = this.backwardNumber(text);//获取文字里面的数字 倒数第三个 类似这样的
|
|
if(houseIndex){
|
|
if(houseIndex){
|
|
houseIndex = this.houseList.length - houseIndex;
|
|
houseIndex = this.houseList.length - houseIndex;
|
|
@@ -302,12 +301,14 @@
|
|
return false;
|
|
return false;
|
|
}else{
|
|
}else{
|
|
houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
|
|
houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
|
|
- }
|
|
|
|
- //全匹配轮一遍
|
|
|
|
- houseIndex = this.houseList.findIndex(space => {
|
|
|
|
- return space.mateStr.includes(text);
|
|
|
|
- })
|
|
|
|
- if (houseIndex==null || houseIndex < 0) {
|
|
|
|
|
|
+ }
|
|
|
|
+ if (houseIndex==null || houseIndex < 0) {//没找到,则进行全匹配
|
|
|
|
+ //全匹配轮一遍
|
|
|
|
+ houseIndex = this.houseList.findIndex(space => {
|
|
|
|
+ return space.mateStr.includes(text);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (houseIndex==null || houseIndex < 0) {//没匹配到,进行最长公共子集匹配
|
|
let list = this.houseList.map((space, index) => {
|
|
let list = this.houseList.map((space, index) => {
|
|
let comStr = this.findSubStr(text, space.mateStr);
|
|
let comStr = this.findSubStr(text, space.mateStr);
|
|
return {
|
|
return {
|