introduce bitloops

This commit is contained in:
mike
2026-01-17 20:24:45 +01:00
parent 8ff9d661e3
commit 938d2ac66b
9 changed files with 46 additions and 53 deletions

View File

@@ -46,8 +46,6 @@ public final class DictJavaGeneratorMulti {
try (var lines = Files.lines(wordsPath, StandardCharsets.UTF_8)) {
lines.forEach(line -> {
CsvIndexService.lineToLemma(line, w -> {
long len = Lemma.length0(w);
String word = Lemma.asWord(w);
String[] clues = CsvIndexService.lineToClue(line);
int simpel = CsvIndexService.lineToSimpel(line);
@@ -61,8 +59,7 @@ public final class DictJavaGeneratorMulti {
var key = Meta.shardKey(w);
ShardBuilder sb = builders.computeIfAbsent(key, k -> new ShardBuilder());
try {
long index = ((long) sb.addRecord(rec) << 3) | len;
map.add(w | (index << 40));
map.add(Lemma.pack(w, sb.addRecord(rec)));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
@@ -165,7 +162,7 @@ public final class DictJavaGeneratorMulti {
w.write("package " + pkg + ";\n\n");
w.write("public final class " + prefix + ci + " {\n");
w.write(" private " + prefix + ci + "() {}\n");
w.write(" public static long[] get() {\n");
w.write(" return new long[] { \n");
for (int i = from; i < to; i++) {