aboutsummaryrefslogtreecommitdiff
path: root/core/raw/api.ts
blob: 2d29eed29a8923c53ac3c33d7dbd55e02194f162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import API from "../api.ts";
import Parser from "../../language/parser.ts";
import YomikunError from "../../util/error.ts";

/** @summary internal Yomikun API client (DO NOT USE DIRECTLY) */
export default class YomikunRAWAPI implements API {
	private _parser: Parser;

	constructor() {
		if (this.constructor === YomikunRAWAPI) {
			throw new YomikunError("YomikunRAWAPI instantiated! please use YomikunDirectAPIClient instead");
		}

		this._parser = new Parser();
	}

  async prepare() {
    await Promise.all([
      this._parser.prepare(),
    ]);
  }

	async parseSentence(input: string) {
		return this._parser.parse(input);
	}
};