From 06e8d0a0d636f539f20ece3d9d767190d0a71b3b Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 29 May 2025 12:46:01 +0700 Subject: m --- src/lib/calls/nlp.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/lib/calls/nlp.ts') diff --git a/src/lib/calls/nlp.ts b/src/lib/calls/nlp.ts index 28562d0..24e7cf3 100644 --- a/src/lib/calls/nlp.ts +++ b/src/lib/calls/nlp.ts @@ -52,3 +52,18 @@ export async function deconstructSyllable(ipa: string): Promise { const jj = await r2.json(); return jj; } + +export async function findLemma(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:8102" + `/spacy`, opts); + const jj = await r2.json(); + return jj; +} -- cgit v1.2.3