diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-07-01 16:37:50 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-07-01 16:37:50 +0200 |
commit | ce9e0788317b25e5d297ed38d9fed0754a341288 (patch) | |
tree | 29563a39c73ded16cd93eb7b5c5664d1ece944ac /core/raw | |
parent | 8ff39cbe6300ca479584fe7d85ff03a1f65bc9b0 (diff) |
WIP sentence API
Diffstat (limited to 'core/raw')
-rw-r--r-- | core/raw/api.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/raw/api.ts b/core/raw/api.ts index f47dead..593b932 100644 --- a/core/raw/api.ts +++ b/core/raw/api.ts @@ -1,27 +1,29 @@ import Core from "../api.ts"; import Parser from "../../language/parser.ts"; import YomikunError from "../../util/error.ts"; +import { DeepPartial } from "../../util/types.ts"; +import { InputSentenceProps } from "../../language/types.ts"; /** @summary internal Core (DO NOT USE DIRECTLY) */ export default class RawCore implements Core { - private _parser: Parser; - ready: Promise<void>; + private parser: Parser; + public ready: Promise<void>; constructor() { if (this.constructor === RawCore) { throw new YomikunError("RawCore instantiated! Use DirectCoreClient instead!"); } - this._parser = new Parser(); + this.parser = new Parser(); this.ready = new Promise(async resolve => { - await this._parser.ready; + await this.parser.ready; resolve(); }) } - async parseSentence(input: string) { - return await this._parser.parse(input); + async parseSentence(input: string, options?: DeepPartial<InputSentenceProps>) { + return await this.parser.parse(input, options); } }; |