Parcourir la source

20250605-生成说明书

lrj il y a 4 mois
Parent
commit
1c2a81d580

+ 1 - 1
src/main/java/cn/cslg/pas/service/dify/GenerateInstructionService.java

@@ -75,7 +75,7 @@ public class GenerateInstructionService {
     public String getClaimContent(String claim) {
        claim= claim.replaceAll("所述","");
         // 正则表达式模式(注意 Java 中需要双反斜杠转义)
-        String regex = "其特征在于[,。;!?、]+(.+)";
+        String regex = "其特征在于[,。;!?、::]+(.+)";
         Pattern pattern = Pattern.compile(regex);
         Matcher matcher = pattern.matcher(claim);
         if (matcher.find()) {

+ 1 - 1
src/test/java/cn/cslg/pas/service/dify/GenerateInstructionServiceTests.java

@@ -26,7 +26,7 @@ public class GenerateInstructionServiceTests {
 
     @Test
     public void getClaimContent() throws Exception {
-        String re = generateInstructionService.getClaimContent("2. 根据权利要求1所述的电磁弹簧,其特征在于,所述弹簧丝在所述电磁件所在区域开设有若干安装槽,所述电磁件嵌设于对应的所述安装槽内。");
+        String re = generateInstructionService.getClaimContent("3.如权利要求2所述的冷却系统,其特征在于:所述预冷却管穿过真空容器延伸到热屏蔽罩的内部。");
         System.out.println(re);
     }