From da28ef4d07281e7533a982c01fc5483edcb202b9 Mon Sep 17 00:00:00 2001 From: Elena Frick Date: Tue, 2 Jul 2024 14:21:56 +0200 Subject: [PATCH] sorted speaker list for KWIC (issue #188) --- .../query/implementations/ISOTEIKWICSnippetCreator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java b/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java index 3b57ab6..d5f6132 100644 --- a/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java +++ b/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java @@ -8,8 +8,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.XMLConstants; @@ -55,7 +56,7 @@ public DefaultKWICSnippet apply(Document transcriptDoc, DefaultKWICSnippet matchSnippet = new DefaultKWICSnippet(); ArrayList content = new ArrayList(); - Set speakers = new HashSet<>(); + SortedSet speakers = new TreeSet<>(); xPath.setNamespaceContext(new ISOTEINamespaceContext()); String xPathString = "//tei:*[@xml:id = '" + leftMatchId + "']";