Vocabulary Autocomplete Pad
Help a writer reuse their own terminology with a small local autocomplete model built from token counts, prefixes and short word histories. Show the evidence behind each suggestion and export an interactive writing pad plus a portable vocabulary model for another editor.
A local autocomplete writing page and vocabulary-model.json
- TypeScript Typed local transformations and portable browser interfaces run with Node standard libraries.
Vocabulary Autocomplete Pad in 4 stages
Build suggestions that explain which words they learned from.
Tokenize a corpus and count word histories
tokenize(text: string): string[]; train(corpus: unknown): Model
starter · ~2 hours · TypeScript
Tokenize a corpus and count word historiesRank prefix and next-word candidates
suggest(model: Model, prefix: string, history?: string[], limit?: number): Suggestion[]
core · ~2 hours · TypeScript
Rank prefix and next-word candidatesAccept suggestions in a writing pad
completeText(model: Model, text: string, limit?: number): {prefix:string;history:string[];suggestions:Suggestion[]}; acceptSuggestion(text:string,prefix:string,word:string):string
core · ~2 hours · TypeScript
Accept suggestions in a writing padExport the learned model and editor function
importModel(value: unknown): Model; renderPad(model: Model, initial?: string): string
stretch · ~2 hours · TypeScript
Export the learned model and editor function