diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-06-28 23:59:50 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-06-28 23:59:50 +0200 |
commit | 67dbb6421976254658c5e38045513129dd18187a (patch) | |
tree | 288b599d1097b26bdbcad3b6749b38e133017cf2 /language/types.ts |
initial public commit
Diffstat (limited to 'language/types.ts')
-rw-r--r-- | language/types.ts | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/language/types.ts b/language/types.ts new file mode 100644 index 0000000..40ea4ba --- /dev/null +++ b/language/types.ts @@ -0,0 +1,49 @@ +import { TokenTags } from "./tags.ts"; + +export enum ParseDepth { + Term, + Glossary, +}; + +export interface TokenReading { + text: string; + ruby?: string; +}; + +export interface GlossaryDefinition { + +}; + +export interface Glossary { + id: number; + definitions: GlossaryDefinition[]; +}; + +export interface ParseToken { + reading: TokenReading[]; + tags: TokenTags; + glossary?: Glossary; + term_id: number; + source: string; +}; + +export interface ParseResult { + depth: ParseDepth; + tokens: ParseToken[] +}; + +/** @summary option struct for Parser */ +export interface InputSentenceProps { + /** @prop max amount of characters to look ahead when attempting to deconjugate */ + lookahead?: number; + /** @prop amount of detail to return in search results */ + depth?: ParseDepth; + /** @prop search bias multipliers */ + priorityMod?: { + /** @prop multiplier for negative bias */ + low?: number; + /** @prop multiplier for positive bias */ + high?: number; + }; +}; + |