浏览代码

杭州第七:加入子女数量判断 **个女,**个子,并在正则中加入两的判断

zhanghang 3 年之前
父节点
当前提交
51b33f621e

+ 10 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hangzhoudiqi/behospitalized/BEH0058.java

@@ -50,16 +50,18 @@ public class BEH0058 extends QCCatalogue {
             return;
         } else {
        //     String regex = ".*\\d?子\\d?女.*";
-            String regex = ".*[\\d一二三四五六七八九十]子[\\d一二三四五六七八九十]女.*";
-            String regex1 = ".*[\\d一二三四五六七八九十][子|男].*";
-            String regex2 = ".*[\\d一二三四五六七八九十]女.*";
-            String regex3 = ".*子数[\\d一二三四五六七八九十].*女数[\\d一二三四五六七八九十].*";
-            String regex4 = ".*女数[\\d一二三四五六七八九十].*子数[\\d一二三四五六七八九十].*";
-            String regex5 = ".*子数[\\d一二三四五六七八九十].*";
-            String regex6 = ".*女数[\\d一二三四五六七八九十].*";
+            String regex = ".*[\\d一两二三四五六七八九十]子[\\d一两二三四五六七八九十]女.*";
+            String regex1 = ".*[\\d一两二三四五六七八九十][子|男].*";
+            String regex2 = ".*[\\d一两二三四五六七八九十]女.*";
+            String regex3 = ".*子数[\\d一两二三四五六七八九十].*女数[\\d一两二三四五六七八九十].*";
+            String regex4 = ".*女数[\\d一两二三四五六七八九十].*子数[\\d一两二三四五六七八九十].*";
+            String regex5 = ".*子数[\\d一两二三四五六七八九十].*";
+            String regex6 = ".*女数[\\d一两二三四五六七八九十].*";
+            String regex7 = ".*[\\d一两二三四五六七八九十]个女.*";
+            String regex8 = ".*[\\d一两二三四五六七八九十]个子.*";
             boolean flag=false;
             if(maritalText.matches(regex1)||maritalText.matches(regex)||maritalText.matches(regex2)||maritalText.matches(regex3)||maritalText.matches(regex4)
-                    ||maritalText.matches(regex5)||maritalText.matches(regex6)){
+                    ||maritalText.matches(regex5)||maritalText.matches(regex6)||maritalText.matches(regex7)||maritalText.matches(regex8)){
              flag=true;
             }
             regex = ".*\\d+-\\d+-\\d+-[1-9].*";