spiegel-keyman/web/src/engine/predictive-text/wordbreakers
Marc Durdin b10634eb97 refactor(common): move all lexical model types into LexicalModelTypes container
Many of the types had very generic names (e.g. `Configuration`), and as
the types are now exported from `@keymanapp/common-types`, this was
unhelpful.

For units with many references, I used TypeScript's import-equals to
reduce the change impact. For units with only a few references, I added
the `LexicalModelTypes.` prefix to the references in source.

(Best reference I could find for import-equals: b722fa4e49)

Fixes: #12516
2024-11-27 09:46:09 +07:00
..
src/main refactor(common): move all lexical model types into LexicalModelTypes container 2024-11-27 09:46:09 +07:00
test refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
tools/data-compiler refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
.c8rc.json refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
.gitignore refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
build.sh refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
package.json refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
README.md refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00
tsconfig.json refactor(web): move common/models to web/src/engine/predictive-text 2024-09-10 17:45:22 +02:00

@keymanapp/models-wordbreakers

The word breakers bundled in Keyman's modeling layer (common/models).

Includes:

  • default — a word breaker based on the Unicode default word boundary specification
  • deprecated ascii — an example word breaker
  • deprecated placeholder — an example word breaker

Usage

import {wordBreakers} from '@keymanapp/models-wordbreakers';
const breakWords = wordBreakers['default'];

console.log(breakWords('Hello, World!').map(span => span.text));
// prints: [ 'Hello', ',', 'World', '!' ]