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