|
@@ -99,7 +99,7 @@ public class EntityProcessOperationDiscussion extends EntityProcess {
|
|
|
String subContentIndex = "", title = "";
|
|
|
for (int i = 0; i < lemmaList.size(); i++) {
|
|
|
lemma = lemmaList.get(i);
|
|
|
- if (!titleList.contains(lemma.getProperty())) {
|
|
|
+ if (!titleList.contains(lemma.getProperty()) && i != lemmaList.size() - 1) {
|
|
|
continue;
|
|
|
}
|
|
|
if (i != lemmaList.size() - 1) {
|
|
@@ -107,18 +107,23 @@ public class EntityProcessOperationDiscussion extends EntityProcess {
|
|
|
start = Integer.parseInt(lemma.getPosition());
|
|
|
title = lemma.getProperty();//截取的这一段文本的标题
|
|
|
} else {
|
|
|
- //subContent = content.substring(start + title.length(), Integer.parseInt(lemma.getPosition()));
|
|
|
subContentIndex = start + lemma.getText().length() + 1 + "," + Integer.parseInt(lemma.getPosition());
|
|
|
putSubContent(titleText, title, subContentIndex);
|
|
|
start = Integer.parseInt(lemma.getPosition());
|
|
|
title = lemma.getProperty();//截取的这一段文本的标题
|
|
|
}
|
|
|
} else {
|
|
|
- //如果是最后一个Lemma,文本就从start开始取,取到结束
|
|
|
- //subContent = content.substring((start + lemma.getText().length()));
|
|
|
- int lastIndex = content.length() - 1;
|
|
|
- subContentIndex = start + lemma.getText().length() + "," + lastIndex;
|
|
|
+ //将倒数第二个标题存入结构
|
|
|
+ subContentIndex = start + "," + Integer.parseInt(lemma.getPosition());
|
|
|
putSubContent(titleText, title, subContentIndex);
|
|
|
+ //如果是最后一个Lemma,文本就从当前lemma的position开始取,取到结束
|
|
|
+ title = lemma.getProperty();//截取的这一段文本的标题
|
|
|
+ if (titleList.contains(title)) {
|
|
|
+ start = Integer.parseInt(lemma.getPosition());
|
|
|
+ int lastIndex = content.length() - 1;
|
|
|
+ subContentIndex = start + "," + lastIndex;
|
|
|
+ putSubContent(titleText, title, subContentIndex);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return titleText;
|