blob: e68fbfee5241d12b0bb9a14523edc685a52cd505 (
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
28
29
30
31
32
33
|
"use server";
import { AsyncRes } from "@/lib/types";
import { NLP } from "sortug-ai";
import ServerWord from "@/zoom/ServerWord";
import { analyzeTHWord, segmentateThai } from "@/lib/calls/nlp";
import SyllableModal from "@/components/Flashcard/SyllableModal";
// import db from "../lib/db";
export async function wordAction(
text: string,
lang: string,
): Promise<React.ReactNode> {
console.log("");
return ServerWord({ word: text, lang });
}
export async function syllableAction(
text: string,
lang: string,
): Promise<React.ReactNode> {
console.log("");
return SyllableModal({ text, lang });
}
export async function thaiAnalysis(text: string) {
const res = await segmentateThai(text);
const res2 = await analyzeTHWord(text);
console.log({ res, res2 });
}
// export async function ocrAction(file: File): AsyncRes<string[]> {
// const res = await NLP.ocr(file);
// return res;
// }
|