spiegel-keyman/common/predictive-text
2024-08-08 07:22:46 +07:00
..
docs chore(common): use /usr/bin/env bash 2022-07-25 14:59:37 +10:00
src fix(web): patch up worker build to provide artifacts for its tests 2024-08-02 10:31:51 +07:00
unit_tests Merge pull request #11933 from keymanapp/fix/web/worker-unit-test-stability 2024-07-22 09:05:28 +07:00
.build-builder chore(common/models): minor tweaks per review 2022-10-05 09:04:23 +07:00
.gitignore change(web): final KMW-bundler script cleanup 2023-12-18 10:23:28 +07:00
build.sh fix(web): configure needs to setup playwright 2024-05-15 15:53:28 +07:00
package.json chore(common): eliminate ts-node ref from most subpackages 2024-06-10 10:07:58 +07:00
README.md chore: establish user-dict epic 2024-08-08 07:22:46 +07:00
tsconfig.all.json chore(web): kmw-main tsconfig -> /web, redirect in /common/web 2023-06-14 08:22:05 +07:00

Language Modelling Layer (LMLayer)

Provide predictions and corrections while you type!

See Worker Communication Protocol for a semi-formal specification on how the Worker and the main thread communicate.

System dependencies

You will need Bash and Node.js >= 10.0.

Build

Run build.sh. This will also automatically install dependencies with npm.

./build.sh configure build

Two-stage compilation process

TODO: this is well and truly out of date...

Since the primary LMLayer code runs within a Web Worker, build.sh compiles the LMLayer in two stages:

  1. Compile the inner worker code

    1. Compile the TypeScript sources for only the Worker code.
    2. Wrap the Worker code as embedded_worker.js
  2. Compile the top-level code

    1. Include embedded_worker.js verbatim using a TypeScript directive.
    2. Compile the top-level TypeScript code.
    3. Unwrap the Worker code at runtime.

Test

This will run both headless unit tests, and in-browser unit tests and integration tests:

./build.sh test

TODO: epic/user-dict