From 49779b079f08418b1493e5e80a0ce7ded8af5539 Mon Sep 17 00:00:00 2001 From: mumuy Date: Tue, 6 Sep 2016 18:31:23 +0800 Subject: [PATCH] =?UTF-8?q?updated=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E5=B7=B2?= =?UTF-8?q?=E7=9F=A5=E6=80=A7=E5=88=AB=E4=B8=8B=EF=BC=8C=E7=88=B8=E7=88=B8?= =?UTF-8?q?=E7=9A=84=E5=84=BF=E5=AD=90=E7=9A=84=E5=84=BF=E5=AD=90=E6=88=96?= =?UTF-8?q?=E7=88=B8=E7=88=B8=E7=9A=84=E5=A5=B3=E5=84=BF=E7=9A=84=E5=84=BF?= =?UTF-8?q?=E5=AD=90=E7=AD=89=E4=B8=8A=E4=B8=8B=E5=85=B3=E7=B3=BB=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/relationship.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/script/relationship.js b/script/relationship.js index 8132e9e..4b9cf8b 100644 --- a/script/relationship.js +++ b/script/relationship.js @@ -32,11 +32,11 @@ str:'$1' }, /* 父母的子女 */ - {//父母的女儿年龄判断是哥哥还是弟弟 + {//父母的女儿年龄判断是姐姐还是妹妹 exp:/,[mf],d&([ol])/, str:',$1s' }, - {//父母的女儿年龄判断是姐姐还是妹妹 + {//父母的儿子年龄判断是哥哥还是弟弟 exp:/,[mf],s&([ol])/, str:',$1b' }, @@ -730,6 +730,13 @@ } }while(s!=selector); if(status){ + if(sex>-1){ //如果自己的性别确定 + if(sex==0&&selector.indexOf(',1')==0){ + return false; + }else if(sex==1&&selector.indexOf(',0')==0){ + return false; + } + } selector = selector.replace(/,[01]/,'').substr(1); //去前面逗号和性别信息 if(selector==''&&sex>-1&&sex!=sex2){ }else{ @@ -861,7 +868,8 @@ window.relationship = relationship; })(window); -// console.log(relationship({text:'爸爸的妈妈的老公的儿子的女儿'})); +// console.log(relationship({text:'爸爸的女儿的儿子'})); +//爸爸的妈妈的老公的儿子的女儿 //老婆的老公 //老公的老婆的儿子的爸爸的老婆的儿子的爸爸 //我的三舅的儿子的爸爸的妹妹的儿子的叔叔的哥哥