updated 表达式语法添加

This commit is contained in:
PASSER-BY 2022-11-13 23:00:51 +08:00
parent 9c5a79c94b
commit 6332afea3a
4 changed files with 20 additions and 14 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,10 +13,13 @@ export default [
})
},
{
exp:/^(\S+?)是(谁|什么亲戚|啥亲戚)?$/,
opt:match=>({
text:match[1]
})
exp:/^(\S+?)是(谁|什么亲戚|啥亲戚|什么辈分|啥辈分)?$/,
opt:match=>{
return {
text:match[1],
type:match[0].indexOf('的')>-1?'default':'chain'
};
}
},
{
exp:/^(\S+?)(应该|得)?(称呼|叫|喊)(\S+?)(什么|啥)?$/,
@ -61,6 +64,13 @@ export default [
type:'chain'
})
},
{
exp:/^(\S+?)(指的)?是(什么|啥)亲戚关系??$/,
opt:match=>({
text:match[1],
type:'chain'
})
},
{
exp:/^(\S+?)对于(\S+?)是(什么|啥)关系??$/,
opt:match=>({

View File

@ -76,9 +76,7 @@ var relationship = function (parameter){
temps = reverseId(id,data['sex']);
temps.forEach(function(r_id){
var pairs = getPairsByIds(id,r_id);
if(pairs.length){
result = result.concat(pairs);
}
});
}else{
temps.forEach(function(id){
@ -86,9 +84,7 @@ var relationship = function (parameter){
if(!items.length){
items = getItemsById(sex+','+id);
}
if(items.length){
result = result.concat(items);
}
});
}
});