summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-06-03 15:41:31 +0700
committerpolwex <polwex@sortug.com>2025-06-03 15:41:31 +0700
commit175ddca375cef765cec8ca5bbc527a205c40bf25 (patch)
treef2e47a5d85e4d5e0297613e5a17cebce7d09b09b /src/actions
parent2401217a4019938d1c1cc61b6e33ccb233eb6e74 (diff)
preeeeettty much done FUCK YES
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/tones.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/actions/tones.ts b/src/actions/tones.ts
index 0f28612..7d9cb34 100644
--- a/src/actions/tones.ts
+++ b/src/actions/tones.ts
@@ -1,6 +1,9 @@
"use server";
+import db from "@/lib/db";
import pdb from "@/lib/db/prosodydb";
+import { MutationOrder } from "@/lib/types/phonetics";
+import { randomFromArray } from "@/lib/utils";
import { WordData } from "@/zoom/logic/types";
// Helper to extract tone from prosody - assuming prosody is an array of objects like [{tone: number}, ...]
@@ -10,6 +13,13 @@ const getTonesFromProsody = (prosody: any): number[] | null => {
}
return null;
};
+
+export async function mutateToneSelection(
+ order: MutationOrder, // Array of tones, one for each syllable. null means any tone.
+) {
+ const res = pdb.fetchWordsByToneSylsWords(order);
+ return res;
+}
export async function fetchWordsByToneAndSyllables(
tones: (string | null)[], // Array of tones, one for each syllable. null means any tone.
) {