From ba2dbc660c229d3e86662d35513dfa7c904d9870 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 23 Nov 2025 13:29:28 +0700 Subject: wew --- packages/prosody-ui/src/thai/logic/thainlp.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/prosody-ui/src/thai/logic') 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 { return await call("/segmentate", { word: sentence }); } -export const POSMAP: Record = { +export const POSMAP = { ADJ: "Adjective", ADP: "Adposition", ADV: "Adverb", @@ -87,4 +87,8 @@ export const POSMAP: Record = { 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]; -- cgit v1.2.3