aboutsummaryrefslogtreecommitdiff
path: root/language/types.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-06-28 23:59:50 +0200
committerlonkaars <loek@pipeframe.xyz>2023-06-28 23:59:50 +0200
commit67dbb6421976254658c5e38045513129dd18187a (patch)
tree288b599d1097b26bdbcad3b6749b38e133017cf2 /language/types.ts
initial public commit
Diffstat (limited to 'language/types.ts')
-rw-r--r--language/types.ts49
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;
+ };
+};
+