From b91b758041cbc7b8bf7e2a4aee8d6228a75d8105 Mon Sep 17 00:00:00 2001 From: polwex Date: Tue, 3 Jun 2025 19:40:34 +0700 Subject: m --- src/lib/calls/nlp.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lib/calls/nlp.ts') diff --git a/src/lib/calls/nlp.ts b/src/lib/calls/nlp.ts index 1e84e93..2810744 100644 --- a/src/lib/calls/nlp.ts +++ b/src/lib/calls/nlp.ts @@ -176,3 +176,17 @@ export async function findLemma(word: string, lang: string) { const jj = await r2.json(); return jj; } +export async function charsiuG2P(word: string, lang: string) { + const opts = { + method: "POST", + headers: { + "Content-type": "application/json", + "X-API-KEY": Bun.env.SORTUG_NLP_API_KEY!, + }, + body: JSON.stringify({ string: word, lang }), + }; + // const r1 = await fetch(`http://localhost:8000/segmentate`, opts); + const r2 = await fetch("http://localhost:8105" + `/ipa`, opts); + const jj = await r2.json(); + return jj; +} -- cgit v1.2.3