introduce bitloops

This commit is contained in:
mike
2026-01-20 12:08:48 +01:00
parent 8780a26451
commit 58b8b57688
29 changed files with 136135 additions and 39251 deletions

View File

@@ -18,7 +18,7 @@ public final class DictJavaGeneratorMulti {
private static final int POS_CHUNK = 8_192;
public static void main(String[] args) throws Exception {
Path wordsFile = Path.of(args.length > 0 ? args[0] : "nl_score_hints_v3.csv");
Path wordsFile = Path.of(args.length > 0 ? args[0] : "nl_score_hints_v4.csv");
Path outDir = Path.of(args.length > 1 ? args[1] : "src/main/generated-sources/puzzle/dict" + THRESS);
String pkg = "puzzle.dict" + THRESS;
HashMap<String, ShardBuilder> builders = new HashMap<String, ShardBuilder>(16);
@@ -277,16 +277,16 @@ public final class DictJavaGeneratorMulti {
}
public static final class CsvIndexService {
static int SIMPEL_IDX = 3;
static int SIMPEL_IDX = 2;
public static int lineToSimpel(String line) {
var parts = line.split(",", 5);
var parts = line.split(",", 4);
return Integer.parseInt(parts[SIMPEL_IDX].trim());
}
public static String[] lineToClue(String line) {
if (line.isBlank()) throw new RuntimeException("Empty line");
var parts = line.split(",", 5);
var rawClue = parts[4].trim();
var parts = line.split(",", 4);
var rawClue = parts[3].trim();
if (rawClue.startsWith("\"") && rawClue.endsWith("\"")) {
rawClue = rawClue.substring(1, rawClue.length() - 1).replace("\"\"", "\"");
}
@@ -296,11 +296,10 @@ public final class DictJavaGeneratorMulti {
if (line.isBlank()) {
throw new RuntimeException("Empty line");
}
var parts = line.split(",", 5);
var id = Integer.parseInt(parts[0].trim());
var word = parts[1].trim();
int score = Integer.parseInt(parts[2].trim());
int simpel = Integer.parseInt(parts[3].trim());
var parts = line.split(",", 4);
var word = parts[0].trim();
int score = Integer.parseInt(parts[1].trim());
int simpel = Integer.parseInt(parts[2].trim());
if (score < 1 || simpel > THRESS) {
if (Main.VERBOSE) System.err.println("Word too complex: " + line);
return;