introduce bitloops
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user