|
@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
|
|
public class ClaimSplitUtils {
|
|
public class ClaimSplitUtils {
|
|
private static final List<String> CNRegix = Arrays.asList("[0-9]+\\.[^0-9]+?", "\\[[0-9]+]");
|
|
private static final List<String> CNRegix = Arrays.asList("[0-9]+\\.[^0-9]+?", "\\[[0-9]+]");
|
|
private static final List<String> JPRegix = Arrays.asList("【請求項[0-9]+】");
|
|
private static final List<String> JPRegix = Arrays.asList("【請求項[0-9]+】");
|
|
- private static final List<String> KORRegix = Arrays.asList("청구항 [0-9]+");
|
|
|
|
|
|
+ private static final List<String> KORRegix = Arrays.asList("청구항 [0-9]+","\\[[0-9]+]");
|
|
private static final List<String> ENReginx = Arrays.asList("[0-9]+\\.[^0-9]+?", "\\[[0-9]+]");
|
|
private static final List<String> ENReginx = Arrays.asList("[0-9]+\\.[^0-9]+?", "\\[[0-9]+]");
|
|
|
|
|
|
|
|
|
|
@@ -31,9 +31,9 @@ public class ClaimSplitUtils {
|
|
try {
|
|
try {
|
|
//国家
|
|
//国家
|
|
String country = params.getCountry();
|
|
String country = params.getCountry();
|
|
- String patentNo =params.getPatentNo();
|
|
|
|
|
|
+ String patentNo = params.getPatentNo();
|
|
if (country == null) {
|
|
if (country == null) {
|
|
- country = params.getPatentNo().substring(0, 2);
|
|
|
|
|
|
+ country = params.getPatentNo().substring(0,2);
|
|
}
|
|
}
|
|
//原文
|
|
//原文
|
|
String content = params.getContent();
|
|
String content = params.getContent();
|
|
@@ -47,22 +47,23 @@ public class ClaimSplitUtils {
|
|
}
|
|
}
|
|
String regex = ClaimSplitUtils.getRegex(country, content);
|
|
String regex = ClaimSplitUtils.getRegex(country, content);
|
|
if (regex == null) {
|
|
if (regex == null) {
|
|
- reDefaultPatentClaim(patentRights, content);
|
|
|
|
|
|
+ reDefaultPatentClaim(patentRights,content);
|
|
return patentRights;
|
|
return patentRights;
|
|
}
|
|
}
|
|
patentRights = splitPatentRight(regex, content);
|
|
patentRights = splitPatentRight(regex, content);
|
|
|
|
|
|
- switch (country) {
|
|
|
|
- case "CN":
|
|
|
|
- loadCNPatentClaim(patentNo,patentRights);
|
|
|
|
- break;
|
|
|
|
- case "FR":
|
|
|
|
- loadFRPatentClaim(patentNo,patentRights);
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- loadENPatentClaim(patentNo,patentRights);
|
|
|
|
- }
|
|
|
|
- return patentRights;
|
|
|
|
|
|
+ switch (country) {
|
|
|
|
+ case "CN":
|
|
|
|
+ loadCNPatentClaim(patentNo, patentRights);
|
|
|
|
+ break;
|
|
|
|
+ case "FR":
|
|
|
|
+ loadFRPatentClaim(patentNo, patentRights);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ loadENPatentClaim(patentNo, patentRights);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return patentRights;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
@@ -81,11 +82,13 @@ public class ClaimSplitUtils {
|
|
Integer num = 1;
|
|
Integer num = 1;
|
|
ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
Boolean flag = true;
|
|
Boolean flag = true;
|
|
|
|
+
|
|
for (int i = 0; i < claimSplitVOS.size(); i++) {
|
|
for (int i = 0; i < claimSplitVOS.size(); i++) {
|
|
Integer start = claimSplitVOS.get(i).getPosition();
|
|
Integer start = claimSplitVOS.get(i).getPosition();
|
|
Integer end = content.length();
|
|
Integer end = content.length();
|
|
String cont = claimSplitVOS.get(i).getContent();
|
|
String cont = claimSplitVOS.get(i).getContent();
|
|
Matcher matcherNum = Pattern.compile(regexNum).matcher(cont);
|
|
Matcher matcherNum = Pattern.compile(regexNum).matcher(cont);
|
|
|
|
+
|
|
//查询当前序号
|
|
//查询当前序号
|
|
if (matcherNum.find()) {
|
|
if (matcherNum.find()) {
|
|
String a = matcherNum.group();
|
|
String a = matcherNum.group();
|
|
@@ -117,7 +120,7 @@ public class ClaimSplitUtils {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (flag.equals(false)) {
|
|
|
|
|
|
+ if (flag.equals(false) || patentRights.size() == 1) {
|
|
reDefaultPatentClaim(patentRights, content);
|
|
reDefaultPatentClaim(patentRights, content);
|
|
}
|
|
}
|
|
return patentRights;
|
|
return patentRights;
|
|
@@ -148,12 +151,16 @@ public class ClaimSplitUtils {
|
|
switch (country) {
|
|
switch (country) {
|
|
case "CN":
|
|
case "CN":
|
|
regixs = ClaimSplitUtils.CNRegix;
|
|
regixs = ClaimSplitUtils.CNRegix;
|
|
|
|
+ break;
|
|
case "JP":
|
|
case "JP":
|
|
regixs = ClaimSplitUtils.JPRegix;
|
|
regixs = ClaimSplitUtils.JPRegix;
|
|
- case "KOR":
|
|
|
|
|
|
+ break;
|
|
|
|
+ case "KR":
|
|
regixs = ClaimSplitUtils.KORRegix;
|
|
regixs = ClaimSplitUtils.KORRegix;
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
regixs = ClaimSplitUtils.ENReginx;
|
|
regixs = ClaimSplitUtils.ENReginx;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
for (String re : regixs) {
|
|
for (String re : regixs) {
|
|
Matcher matcher = Pattern.compile(re).matcher(content);
|
|
Matcher matcher = Pattern.compile(re).matcher(content);
|
|
@@ -166,8 +173,7 @@ public class ClaimSplitUtils {
|
|
}
|
|
}
|
|
|
|
|
|
private static void reDefaultPatentClaim(ArrayList<RePatentClaim> patentRights, String content) {
|
|
private static void reDefaultPatentClaim(ArrayList<RePatentClaim> patentRights, String content) {
|
|
- patentRights = new ArrayList<>();
|
|
|
|
-
|
|
|
|
|
|
+ patentRights.clear();
|
|
RePatentClaim rePatentClaim = new RePatentClaim();
|
|
RePatentClaim rePatentClaim = new RePatentClaim();
|
|
rePatentClaim.setSort(1);
|
|
rePatentClaim.setSort(1);
|
|
rePatentClaim.setContent(content);
|
|
rePatentClaim.setContent(content);
|
|
@@ -176,7 +182,7 @@ public class ClaimSplitUtils {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private static void loadCNPatentClaim(String patentNo,ArrayList<RePatentClaim> rePatentClaims) {
|
|
|
|
|
|
+ private static void loadCNPatentClaim(String patentNo, ArrayList<RePatentClaim> rePatentClaims) {
|
|
String regex1 = "权利要求[0-9]+";
|
|
String regex1 = "权利要求[0-9]+";
|
|
String regex2 = "权利要求[0-9]+[至或~-]+[0-9]+";
|
|
String regex2 = "权利要求[0-9]+[至或~-]+[0-9]+";
|
|
|
|
|