|
@@ -403,19 +403,26 @@ public class RuleCheckMachine {
|
|
this.addAll(set, this.insideMap.get("punc").get(aPunc));
|
|
this.addAll(set, this.insideMap.get("punc").get(aPunc));
|
|
}
|
|
}
|
|
|
|
|
|
- // 逗号+属性 过滤
|
|
|
|
- int commaIndex = sentence.indexOf(",", entity_1_start + 1); // 逗号位置
|
|
|
|
- String commaPadType = ""; // 逗号拼接上类型
|
|
|
|
- while (commaIndex > -1 && commaIndex < entity_2_start) {
|
|
|
|
- for (int i = startIndex; i <= endIndex; i++) {
|
|
|
|
- NameTypeStartPosition nameTypeStartPosition = nameTypeStartPositions.get(i);
|
|
|
|
- if (nameTypeStartPosition.getStartPosition() > commaIndex) {
|
|
|
|
- commaPadType = "," + nameTypeStartPosition.getType();
|
|
|
|
- set.addAll(this.insideMap.get("typePunctuation").get(commaPadType));
|
|
|
|
- }
|
|
|
|
|
|
+ // 中文和英文逗号+属性 过滤
|
|
|
|
+ String[] commas = {",", ","};
|
|
|
|
+ int commaIndex = 0;
|
|
|
|
+ String commaPadType = null; // 逗号拼接上类型
|
|
|
|
+ for (String comma: commas) {
|
|
|
|
+ commaIndex = sentence.indexOf(comma, entity_1_start + 1); // 逗号位置
|
|
|
|
+ while (commaIndex > -1 && commaIndex < entity_2_start) {
|
|
|
|
+ commaIndex = sentence.indexOf(comma, commaIndex + 1); // 下一个逗号
|
|
|
|
+ for (int i = startIndex; i <= endIndex; i++) { // 每个逗号与后面的所有实体都匹配一次
|
|
|
|
+ NameTypeStartPosition nameTypeStartPosition = nameTypeStartPositions.get(i);
|
|
|
|
+ if (nameTypeStartPosition.getStartPosition() > commaIndex) {
|
|
|
|
+ commaPadType = "," + nameTypeStartPosition.getType();
|
|
|
|
+ set.addAll(this.insideMap.get("typePunctuation").get(commaPadType));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
this.retainAll(remainUuids, set); // 求交集,同事中间实体相关的过滤条件,且不不满足例外情况
|
|
this.retainAll(remainUuids, set); // 求交集,同事中间实体相关的过滤条件,且不不满足例外情况
|
|
|
|
|
|
// for (FilterRule rule: this.filterRules) {
|
|
// for (FilterRule rule: this.filterRules) {
|