VR keyboard: unused exports and fields removed

textmodel's lastReset (the patch logs the reason itself), __sfuiSwipe.model,
corrector's distance/fold and the decoder's N/W/cost/resample exports were
read by nothing (patch, tests, replay script).
This commit is contained in:
Pierre Kisters committed 2026-10-01 04:09:13 +02:00
1 parent 70e9a1aeb1
commit 378265389d
4 files changed
+7 -9

No files matched your search

+3 -3
View File
@@ -11,7 +11,7 @@
// same-folded variant is >= 1 zipf more frequent ("cant" -> "can't").
// Memory: one folded string + 26 bytes per word.
(() => {
const VERSION = 2;
const VERSION = 3;
const fold = (w) => w.toLowerCase().replace(/['’-]/g, '')
.replace(/ä/g, 'ae').replace(/ö/g, 'oe').replace(/ü/g, 'ue').replace(/ß/g, 'ss');
const VARIANT_GAP = 1.0;
@@ -114,8 +114,8 @@
return pickWords(prefix, hits.sort((a, b) => dict.freq[b] - dict.freq[a]), max);
}
return { corrections, completions, setLayout, distance };
return { corrections, completions, setLayout };
}
return { VERSION, create, fold };
return { VERSION, create };
})()
-1
View File
@@ -156,7 +156,6 @@
// ---- text model, hooks, resets --------------------------------------------------
const model = T.create({ size: O.bufferChars });
S.model = model;
let lastActivity = Date.now();
const activity = () => { lastActivity = Date.now(); };
let refreshQueued = false;
+3 -3
View File
@@ -1,12 +1,12 @@
// swipe-decoder.js: swipe path -> words. Evaluates to { VERSION, parseDict,
// layout, decode, ... }. SHARK2-style template matching (Kristensson & Zhai 2004):
// layout, decode }. SHARK2-style template matching (Kristensson & Zhai 2004):
// each word's ideal path runs through its key centres; candidates starting
// and ending near the path's ends, with every key near the path, are scored
// by point distances of the resampled paths (proportional and DTW), how
// closely the path passes their keys in order, path length and frequency.
// Distances are in key widths. ' and - are typed, not swiped.
(() => {
const VERSION = 3;
const VERSION = 4;
const N = 32; // resample points
const SKIP = new Set(["'", '-', '\u2019']);
// Cost weights and pruning limits (tuned with tests/swipe-decoder.test.mjs; distances in key widths).
@@ -225,5 +225,5 @@
return res;
}
return { VERSION, N, W, cost, parseDict, layout, decode, resample };
return { VERSION, parseDict, layout, decode };
})()
+1 -2
View File
@@ -9,7 +9,7 @@
// replacement (swipe candidates, corrections, completions) goes through an
// intact anchor, so it deletes exactly what it typed or nothing.
(() => {
const VERSION = 5;
const VERSION = 6;
const TERMINATORS = new Set([...' .,!?;:']);
const OPENING = new Set([...'([{<"\'„“‚‘«‹¿¡/@#-_']); // no auto-space after these
const isWordChar = (c) => /[\p{L}\p{N}'’-]/u.test(c);
@@ -27,7 +27,6 @@
m.startKnown = boundary;
m.version++;
epoch++;
m.lastReset = why;
},
freeze() { epoch++; },
// Returns false if the key reset the model.