test.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package cn.cslg.pas.service;
  2. import org.junit.jupiter.api.Test;
  3. import org.springframework.boot.test.context.SpringBootTest;
  4. /**
  5. * @author chenyu
  6. * @date 2023/9/1
  7. */
  8. @SpringBootTest
  9. public class test {
  10. @Test
  11. void test() {
  12. String text = "【請求項1】\n" +
  13. "複数の電源と;\n" +
  14. "各々が前記電源の1つに関連し、前記関連する電源の性能データを収集する複数の監視モジュールと;\n" +
  15. "各々が前記監視モジュールの1つに関連し、前記性能データを送信する複数の送信機と;\n" +
  16. "各々が前記送信機の1つに関連し、タイマーの初期化からの経過時間に応じて送信イベントを制御する複数のコントローラと\n" +
  17. "を具えていることを特徴とする分散型DC電力設備用監視システム。\n";
  18. boolean result1 = text.contains("、");
  19. boolean result2 = text.substring(0, text.indexOf("、")).contains("請求項");
  20. boolean result3 = text.contains("、");
  21. boolean result4 = text.contains("請求項");
  22. if ((text.contains("、") && text.substring(0, text.indexOf("、")).contains("請求項")) || (!text.contains("、") && text.contains("請求項"))) {
  23. System.out.println("通过");
  24. }
  25. // if ((strs[i].contains("、") && strs[i].substring(0, strs[i].indexOf("、")).contains("請求項")) || (!strs[i].contains("、") && strs[i].contains("請求項"))) {
  26. //
  27. // }
  28. }
  29. }