spiegel-keyman/developer/docs/help/reference/api/kmc-model.lexicalmodelsource.md
Marc Durdin b751336c13 refactor(developer): copy dev 17.0 help into repo
1. Copy help.keyman.com/developer/17.0/* into /developer/docs/help
2. Update references to 18.0 where appropriate
3. Copy all referenced images from /cdn/dev into
   /developer/docs/help/images and update links in documentation

Next commit: add deployment to help-keyman-com.sh. Note: simplest way to
test links at this point is to use the help.keyman.com auto deploy and
wait for the PR on help.keyman.com to be validated; we could look at an
internal link validation tool that verifies markdown links?

Relates-to: #12347
2024-09-16 08:46:24 +07:00

2.9 KiB

Home > @keymanapp/kmc-model > LexicalModelSource

LexicalModelSource interface

Base interface for a lexical model source definition

Signature:

export interface LexicalModelSource extends LexicalModelDeclaration 

Extends: LexicalModelDeclaration

Properties

Property Modifiers Type Description
applyCasing? readonly CasingFunction

(Optional) Specifies the casing rules for a language. Should implement three casing forms: - 'lower' -- a fully-lowercased version of the text appropriate for the language's use of the writing system. - 'upper' -- a fully-uppercased version of the text - 'initial' -- a version preserving the input casing aside from the initial character, which is uppercased (like with proper nouns and sentence-initial words in English sentences.)

This is only utilized if languageUsesCasing is defined and set to true. 14.0

languageUsesCasing? readonly boolean (Optional) When set to true, suggestions will attempt to match the case of the input text even if the lexicon entries use a different casing scheme due to search term keying effects. 14.0
punctuation? readonly LexicalModelPunctuation (Optional) Punctuation and spacing suggested by the model.
rootClass? readonly string (Optional) The name of the type to instantiate (without parameters) as the base object for a custom predictive model.
searchTermToKey? readonly WordformToKeySpec (Optional) How to simplify words, to convert them into simplified search keys This often involves removing accents, lowercasing, etc.
sources readonly Array<string>
wordBreaker? readonly WordBreakerSpec | SimpleWordBreakerSpec

(Optional) Which word breaker to use. Choose from:

- 'default' -- breaks according to Unicode UAX #29 §4.1 Default Word Boundary Specification, which works well for *most* languages. - 'ascii' -- a very simple word breaker, for demonstration purposes only. - word breaking function -- provide your own function that breaks words. - class-based word-breaker - may be supported in the future.