feat: 文档附录拆分没有将子集归拢的问题
This commit is contained in:
@@ -585,6 +585,28 @@ public class FileSpiltService {
|
|||||||
boolean isAppendix = ReUtil.isMatch(RegexPool.WORD, numberStr);
|
boolean isAppendix = ReUtil.isMatch(RegexPool.WORD, numberStr);
|
||||||
if (isAppendix){
|
if (isAppendix){
|
||||||
treeName = numberStr;
|
treeName = numberStr;
|
||||||
|
} else {
|
||||||
|
// 如果treeName包含“附录”字样
|
||||||
|
if (treeName.contains("附录")) {
|
||||||
|
// 找到“附录”在字符串中的索引位置
|
||||||
|
int appendixIndex = treeName.indexOf("附录");
|
||||||
|
|
||||||
|
// 从“附录”之后获取字母及忽略可能存在的空格
|
||||||
|
String appendixPart = treeName.substring(appendixIndex + 2).trim();
|
||||||
|
|
||||||
|
// 提取第一个非空格字符,假定该字符为附录字母
|
||||||
|
if (!appendixPart.isEmpty()) {
|
||||||
|
String appendixLetter = appendixPart.substring(0, 1);
|
||||||
|
|
||||||
|
// 判断该字符是否为字母
|
||||||
|
if (ReUtil.isMatch(RegexPool.WORD, appendixLetter)) {
|
||||||
|
treeName = appendixLetter; // 将附录字母赋值给treeName
|
||||||
|
} else {
|
||||||
|
// 如果不是有效字母,可以根据业务逻辑处理
|
||||||
|
treeName = ""; // 或设定默认值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch (enumByValue) {
|
switch (enumByValue) {
|
||||||
case GB:
|
case GB:
|
||||||
|
|||||||
Reference in New Issue
Block a user