|
@@ -1,6 +1,7 @@
|
|
|
package cn.cslg.pas.common.utils;
|
|
|
|
|
|
|
|
|
+import cn.cslg.pas.common.utils.ClaimUtils.ClaimSplitUtils;
|
|
|
import cn.cslg.pas.common.vo.PatentRightParams;
|
|
|
import cn.cslg.pas.common.vo.RePatentClaim;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -21,56 +22,59 @@ import java.util.stream.Collectors;
|
|
|
@Component
|
|
|
public class PatentRightUtils {
|
|
|
|
|
|
- public static List<RePatentClaim> formatPatentRight(PatentRightParams params) {
|
|
|
- try {
|
|
|
- //国家
|
|
|
- String country = params.getCountry();
|
|
|
- if (country == null) {
|
|
|
- country = params.getPatentNo().substring(0, 2);
|
|
|
- }
|
|
|
- //原文
|
|
|
- String content = params.getContent();
|
|
|
-
|
|
|
- //创建一个权要集合
|
|
|
- ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
|
-
|
|
|
- //若原文为null或空串,则直接结束并返回空集合;若译文为null,则置为空串
|
|
|
- if (content == null || content.equals("")) {
|
|
|
- return patentRights;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //将原文和译文的所有换行符 "\r\n"或是"\n" 替换成 "@",这样首先可以使得全文连在一起,其次再根据特殊符号@拆分权要
|
|
|
- if (content.contains("\r\n")) {
|
|
|
- content = content.replaceAll("\r\n", "@");
|
|
|
- }
|
|
|
-
|
|
|
- if (content.contains("\n")) {
|
|
|
- content = content.replaceAll("\n", "@");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //中日韩权要↓
|
|
|
- if (country.equals("CN") || country.equals("JP") || country.equals("KR") || content.contains("权利要求")) {
|
|
|
- getChinaRights(content, params.getPatentNo(), patentRights);
|
|
|
- //英文专利的权要拆分 ↓
|
|
|
- } else if (country.equals("FR")) {
|
|
|
- getFRRight(content, params.getPatentNo(), patentRights);
|
|
|
- } else {
|
|
|
- getForeignRights(content, params.getPatentNo(), patentRights);
|
|
|
- }
|
|
|
-
|
|
|
- return patentRights;
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
|
- patentRights.add(new RePatentClaim().setPatentNo(params.getPatentNo()).setContent(params.getContent()).setContentOut(params.getContentOut()).setType(1).setSort(0).setParentSort("-1"));
|
|
|
- return patentRights;
|
|
|
- }
|
|
|
-
|
|
|
+// public static List<RePatentClaim> formatPatentRight(PatentRightParams params) {
|
|
|
+// try {
|
|
|
+// //国家
|
|
|
+// String country = params.getCountry();
|
|
|
+// if (country == null) {
|
|
|
+// country = params.getPatentNo().substring(0, 2);
|
|
|
+// }
|
|
|
+// //原文
|
|
|
+// String content = params.getContent();
|
|
|
+//
|
|
|
+// //创建一个权要集合
|
|
|
+// ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
|
+//
|
|
|
+// //若原文为null或空串,则直接结束并返回空集合;若译文为null,则置为空串
|
|
|
+// if (content == null || content.equals("")) {
|
|
|
+// return patentRights;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// //将原文和译文的所有换行符 "\r\n"或是"\n" 替换成 "@",这样首先可以使得全文连在一起,其次再根据特殊符号@拆分权要
|
|
|
+// if (content.contains("\r\n")) {
|
|
|
+// content = content.replaceAll("\r\n", "@");
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (content.contains("\n")) {
|
|
|
+// content = content.replaceAll("\n", "@");
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// //中日韩权要↓
|
|
|
+// if (country.equals("CN") || country.equals("JP") || country.equals("KR") || content.contains("权利要求")) {
|
|
|
+// getChinaRights(content, params.getPatentNo(), patentRights);
|
|
|
+// //英文专利的权要拆分 ↓
|
|
|
+// } else if (country.equals("FR")) {
|
|
|
+// getFRRight(content, params.getPatentNo(), patentRights);
|
|
|
+// } else {
|
|
|
+// getForeignRights(content, params.getPatentNo(), patentRights);
|
|
|
+// }
|
|
|
+//
|
|
|
+// return patentRights;
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// ArrayList<RePatentClaim> patentRights = new ArrayList<>();
|
|
|
+// patentRights.add(new RePatentClaim().setPatentNo(params.getPatentNo()).setContent(params.getContent()).setContentOut(params.getContentOut()).setType(1).setSort(0).setParentSort("-1"));
|
|
|
+// return patentRights;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
+ public static List<RePatentClaim> formatPatentRight(PatentRightParams params) {
|
|
|
+ return ClaimSplitUtils.formatPatentRight(params);
|
|
|
}
|
|
|
-
|
|
|
public static String getFormatClaim(String claim, String country) {
|
|
|
String reStr = "";
|
|
|
PatentRightParams params = new PatentRightParams();
|
|
@@ -79,7 +83,7 @@ public class PatentRightUtils {
|
|
|
}
|
|
|
params.setContent(claim);
|
|
|
params.setCountry(country);
|
|
|
- List<RePatentClaim> rePatentClaims = PatentRightUtils.formatPatentRight(params);
|
|
|
+ List<RePatentClaim> rePatentClaims = ClaimSplitUtils.formatPatentRight(params);
|
|
|
if (rePatentClaims.size() > 0) {
|
|
|
List<String> claims = rePatentClaims.stream().map(RePatentClaim::getContent).collect(Collectors.toList());
|
|
|
reStr = StringUtils.join(claims, "\t");
|