mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
Apply R1's English typo and contraction rules before spatial search and match its language weight, shortlist and valid-spelling margins. A mapped SCOWL spelling list supplies the validity check missing on Android. Scale vertical spread and the missing-space cost to real Android row geometry so "seehkw" still splits into "see how". Keep the existing en/es model bytes. Build the new German and Bokmål HXTM files with the shared iOS writer. German uses all Google Books v3 shards; Bokmål uses NB book counts filtered by the complete 2022 Ordbank snapshot. Pin the new assets, credit their sources and licences, and ship their real layouts, accents and suggestions. Replace the post-setup list with the iOS-style Home, local Dictate bar and four settings pages. Follow the system language by default; make the spoken language switchable on space, and optionally pin an independent layout. Verified on the Studio API 35 ARM64 emulator: 1,027 English and 1,374 Spanish word errors vs R1's 1,163 and 1,387 on the same 2,000 synthetic sentences per language. Ran all five unit tests in debug and release, inspected the packaged assets, and checked external-editor suggestions, corrections, undo and offline microphone insertion, plus Home and settings in both themes. The Swift reader round-tripped both new models; the identical iOS files are in the separate local commit 230a437e.
21 lines
1.2 KiB
Shell
Executable file
21 lines
1.2 KiB
Shell
Executable file
#!/bin/sh
|
|
# Run in the Android project on the Studio. The debug APK is already installed.
|
|
set -eu
|
|
: "${ANDROID_HOME:?}" "${JAVA_HOME:?}" "${T:?Studio phase scratch}" "${ANDROID_SERIAL:?}"
|
|
cd "$(dirname "$0")/../.."
|
|
lib="$ANDROID_HOME/platforms/android-35/android.jar"
|
|
bt="$ANDROID_HOME/build-tools/35.0.0"
|
|
work="$T/replay"; dev=/data/local/tmp/hex4
|
|
mkdir -p "$work/classes"; adb shell mkdir -p "$dev"
|
|
"$JAVA_HOME/bin/javac" --release 8 -cp "$lib:app/build/tmp/kotlin-classes/debug" -d "$work/classes" benchmark/typing/Replay.java
|
|
"$JAVA_HOME/bin/jar" cf "$work/replay-classes.jar" -C "$work/classes" .
|
|
"$bt/d8" --min-api 31 --lib "$lib" --output "$work/replay-dex.jar" "$work/replay-classes.jar"
|
|
adb push "$work/replay-dex.jar" "$dev/replay.jar" >/dev/null
|
|
adb shell chmod 444 "$dev/replay.jar"
|
|
apk=$(adb shell pm path ly.anoma.hex | tr -d '\r' | sed 's/^package://')
|
|
adb push app/src/main/assets/typing/en.valid "$dev/en.valid" >/dev/null
|
|
for lang in en es; do
|
|
adb push "app/src/main/assets/typing/$lang.hextm" "$dev/$lang.hextm" >/dev/null
|
|
adb push "$T/bench/$lang.jsonl" "$dev/$lang.jsonl" >/dev/null
|
|
adb shell "CLASSPATH=$dev/replay.jar:$apk app_process /system/bin local.hex.bench.Replay $dev/$lang.hextm $dev/$lang.jsonl $lang"
|
|
done
|