summaryrefslogtreecommitdiff
path: root/packages/prosody-ui/src/thai/logic/thainlp.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/prosody-ui/src/thai/logic/thainlp.ts')
-rw-r--r--packages/prosody-ui/src/thai/logic/thainlp.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/prosody-ui/src/thai/logic/thainlp.ts b/packages/prosody-ui/src/thai/logic/thainlp.ts
index 031bf4c..dc6ed23 100644
--- a/packages/prosody-ui/src/thai/logic/thainlp.ts
+++ b/packages/prosody-ui/src/thai/logic/thainlp.ts
@@ -1,4 +1,4 @@
-import type { AsyncRes } from "sortug";
+import type { AsyncRes } from "@sortug/lib";
import type { AnalyzeRes } from "../../logic/types";
const ENDPOINT = "http://192.168.1.110:8001";
@@ -24,7 +24,7 @@ export async function segmentateThai(sentence: string): AsyncRes<AnalyzeRes[]> {
return await call("/segmentate", { word: sentence });
}
-export const POSMAP: Record<string, string> = {
+export const POSMAP = {
ADJ: "Adjective",
ADP: "Adposition",
ADV: "Adverb",
@@ -87,4 +87,8 @@ export const POSMAP: Record<string, string> = {
EITT: "Ending for interrogative sentence",
NEG: "Negator",
PUNC: "Punctuation",
-};
+} as const;
+type POSTYPE = typeof POSMAP;
+
+export type POS_CODE = keyof POSTYPE;
+export type POS = POSTYPE[POS_CODE];