|
@@ -97,12 +97,17 @@ public class RelationTreeUtils {
|
|
|
|
|
|
List<List<String>> branches = new ArrayList<>();
|
|
List<List<String>> branches = new ArrayList<>();
|
|
for (Lemma lemma : leafNodeLemmas.keySet()) {
|
|
for (Lemma lemma : leafNodeLemmas.keySet()) {
|
|
- List<String> aBranch = new ArrayList<>();
|
|
|
|
|
|
+ List<Lemma> aBranch = new ArrayList<>();
|
|
while (lemma != null) {
|
|
while (lemma != null) {
|
|
- aBranch.add(lemma.getText()); // 只加入,文本
|
|
|
|
|
|
+ aBranch.add(lemma);
|
|
lemma = lemma.getParent();
|
|
lemma = lemma.getParent();
|
|
}
|
|
}
|
|
- branches.addAll(permute(aBranch)); // 排列
|
|
|
|
|
|
+ aBranch.sort(Comparator.naturalOrder()); // 按位置排序
|
|
|
|
+ List<String> ordered_names = new ArrayList<>();
|
|
|
|
+ for (Lemma le: aBranch) {
|
|
|
|
+ ordered_names.add(le.getText());
|
|
|
|
+ }
|
|
|
|
+ branches.add(ordered_names);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|