Skip to content

Commit 7bcdf23

Browse files
authored
du/pl ; wildcards
2 parents 38c7239 + 6e00692 commit 7bcdf23

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
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

src/main/resources/elasticsearch/settings/indices/lemma.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@
6363
"transcription_suffix_filter": {
6464
"type": "mapping",
6565
"mappings": [
66-
".t.pl => .wt",
67-
".t:pl => .wt",
68-
".tpl => .wt",
69-
"t.du => .tj",
70-
"t:du => .tj",
71-
".tdu => .tj",
72-
",t,pl => ,wt",
73-
",tpl => ,wt",
74-
"t,du => ,tj",
75-
",tdu => ,tj",
76-
"du => wj",
77-
"pl => w",
7866
", => ."
7967
]
8068
},

0 commit comments

Comments
 (0)