0.0.11 • Published 2 years ago
spoken-pressagio v0.0.11
spoken-pressagio / Exports
spoken-pressagio
Basic Usage
Import library
import { Pressagio } from 'spoken-pressagio';
Database will be empty, so you should add data first to create predictions:
await p.parseText('Adding this phrase to the database);
Now you can predict based off of the database data.
let predictions: Prediction = {};
predictions = await p.predict('');
// or
p.predict('Adding this phr')
.then(result => predictions = result);
console.log(predictions);
// Prediction{
// suggestions: [
// { word: 'phrase', probability: 1 }
// ]
// }
Table of contents
Classes
- CapacitorDatabaseConnector
- ContextTracker
- ForwardTokenizer
- JSDatabaseConnector
- Prediction
- Pressagio
- ReverseTokenizer
- SQLiteService
- SingleNGram
- SingleNGramCount
- SingleNGramProbabilities
- SmoothedNgramPredictor
Interfaces
- PressagioCharacter
- PressagioConfig
- PressagioUnicode
- SmallerLikeTableResult
- Suggestion
- candidateResult
- nGramCount
- ngramMap
Type Aliases
Variables
Type Aliases
WebSQLResponse
Ƭ WebSQLResponse: SingleNGram
[] | SingleNGramCount
[] | SingleNGramProbabilities
[] | undefined
Defined in
nGram
Ƭ nGram: { word
: string
}[]
Defined in
Variables
pConfig
• Const
pConfig: PressagioConfig