aboutsummaryrefslogtreecommitdiff
path: root/core/raw/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'core/raw/api.ts')
-rw-r--r--core/raw/api.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/raw/api.ts b/core/raw/api.ts
index 2d29eed..06db022 100644
--- a/core/raw/api.ts
+++ b/core/raw/api.ts
@@ -5,6 +5,7 @@ import YomikunError from "../../util/error.ts";
/** @summary internal Yomikun API client (DO NOT USE DIRECTLY) */
export default class YomikunRAWAPI implements API {
private _parser: Parser;
+ ready: Promise<void>;
constructor() {
if (this.constructor === YomikunRAWAPI) {
@@ -12,16 +13,15 @@ export default class YomikunRAWAPI implements API {
}
this._parser = new Parser();
- }
- async prepare() {
- await Promise.all([
- this._parser.prepare(),
- ]);
- }
+ this.ready = new Promise(async resolve => {
+ await this._parser.ready;
+ resolve();
+ })
+ }
async parseSentence(input: string) {
- return this._parser.parse(input);
+ return await this._parser.parse(input);
}
};