From ce9e0788317b25e5d297ed38d9fed0754a341288 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 1 Jul 2023 16:37:50 +0200 Subject: WIP sentence API --- core/raw/api.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'core/raw') 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; + private parser: Parser; + public ready: Promise; 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) { + return await this.parser.parse(input, options); } }; -- cgit v1.2.3