aboutsummaryrefslogtreecommitdiff
path: root/api/yomikun.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/yomikun.ts')
-rw-r--r--api/yomikun.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/api/yomikun.ts b/api/yomikun.ts
index 696361f..2b102fe 100644
--- a/api/yomikun.ts
+++ b/api/yomikun.ts
@@ -4,6 +4,9 @@ import Sentence from "./sentence.ts";
export default class Yomikun {
protected core: Core;
+ protected user: string = "root";
+ protected uid: number = 0;
+
public ready: Promise<void>;
constructor(core?: Core) {
@@ -16,9 +19,18 @@ export default class Yomikun {
}
async sentence(input: string): Promise<Sentence> {
- var sentence = new Sentence(input).withParent(this);
+ var sentence = new Sentence(input).withAPI(this);
await sentence.ready;
return sentence;
}
+
+ public su(user: string) {
+ this.user = user;
+ // TODO: set this.uid
+ }
+
+ private async setTermPriority(expression: string, reading: string, priority: number) {
+ this.core.user.termPriority(this.uid, expression, reading, priority);
+ }
}