summaryrefslogtreecommitdiff
path: root/src/lib/calls/nlp.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/calls/nlp.ts')
-rw-r--r--src/lib/calls/nlp.ts15
1 files changed, 15 insertions, 0 deletions
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<SyllableRes> {
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;
+}