spiegel-keyman/common/models/wordbreakers
2022-09-19 15:34:19 +10:00
..
src feat(common/models): adds tokenization tests for wordbreaks near the caret 2022-09-15 13:23:21 +07:00
test feat(common/models): actual wordbreaker customization 2022-09-13 10:18:24 +07:00
.gitignore chore(web): make build paths consistent 2022-05-04 10:13:44 +10:00
package.json chore(deps): bump nanoid and mocha 2022-09-16 21:06:23 +00:00
README.md docs(common/models): Apply suggestions from code review 2020-05-19 15:30:43 -06:00
tsconfig.json chore(web): make build paths consistent 2022-05-04 10:13:44 +10: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', '!' ]