Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ANNIS is a frontend to the graphANNIS webservice, which has its [own changelog](

- Document names containing an umlaut or other special characters were shown
percent encoded in the match list ([#837](https://github.com/korpling/ANNIS/issues/837)).
- RST segments did not sort their token theirself, but relied on external mechanisms to
already get sorted tokens. Changed to explicitly sort the output. (#913)

## [4.15.3] - 2026-06-25

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -262,6 +261,7 @@ private boolean isSecondarySignalNode(SNode sNode) {

private String transformSaltToJSON(VisualizerInput visInput) {
graph = visInput.getSResult().getDocumentGraph();

List<SNode> rootSNodes = graph.getRoots();
List<SNode> rstRoots = new ArrayList<SNode>();

Expand Down Expand Up @@ -376,7 +376,7 @@ private JSONObject createJsonEntry(SNode currNode) {
JSONObject data = new JSONObject();
StringBuilder sb = new StringBuilder();
// use a hash set so we don't get any duplicate entries
LinkedHashSet<SToken> token = new LinkedHashSet<>();
HashSet<SToken> tokenSet = new HashSet<>();
List<SRelation<SNode, SNode>> edges;

if (currNode instanceof SStructure) {
Expand All @@ -386,11 +386,12 @@ private JSONObject createJsonEntry(SNode currNode) {
// get all tokens directly dominated tokens and build a string
for (SRelation<SNode, SNode> sedge : edges) {
if (sedge.getTarget() instanceof SToken) {
token.add((SToken) sedge.getTarget());
tokenSet.add((SToken) sedge.getTarget());
}
}

// build strings
// build strings from sorted token
List<SToken> token = graph.getSortedTokenByText(new ArrayList<>(tokenSet));
Iterator<SToken> tokIterator = token.iterator();
while (tokIterator.hasNext()) {
SToken tok = tokIterator.next();
Expand Down Expand Up @@ -441,7 +442,7 @@ private JSONObject createJsonEntry(SNode currNode) {


// since we have found some tokens, it must be a sentence in RST.
if (token.size() > 0) {
if (!tokenSet.isEmpty()) {
data.put("sentence", sb.toString());
}

Expand Down
Loading