Skip to content

Commit 6e00692

Browse files
committed
Classic Wildcards
1 parent c8c99a6 commit 6e00692

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/tla/backend/es/query/LemmaSearchQueryBuilder.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,17 @@ public String maskRegExTranscription(String transcription) {
146146
transcription = transcription.replace("⸮", "");
147147
// "?", "[" , and "]" are part of allowed RegEx syntax
148148

149-
// BTS wildcards (any sign)
149+
// leagacy TLA wildcards
150150
transcription = transcription.replace("§", "."); // "§" in legacyTLA
151-
transcription = transcription.replace("*", "."); // "*" new in newTLA
151+
152+
// Usual wildcards
153+
transcription = transcription.replace("_", "."); // any sigle sign
154+
transcription = transcription.replace("*", ".*"); // zero or more signs
152155

153156
// treatment of right end
154157
if (transcription.endsWith("$")) { // "$": wirkliches String-Ende
155158
transcription = transcription.replace("$", ""); // remove "$" (all, just to be sure)
156-
} else {
159+
} else if (!transcription.endsWith(".*")) { // redundant if already ends with ".*"
157160
transcription = transcription + ".*"; // right: any signs may follow
158161
}
159162

0 commit comments

Comments
 (0)