summaryrefslogtreecommitdiff
path: root/src/actions/tones.ts
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-06-03 09:34:29 +0700
committerpolwex <polwex@sortug.com>2025-06-03 09:34:29 +0700
commit2401217a4019938d1c1cc61b6e33ccb233eb6e74 (patch)
tree06118284965be5cfd6b417dca86d46db5758217b /src/actions/tones.ts
parent2b80f7950df34f2a160135d7e20220a9b2ec3352 (diff)
this is golden thanks claude
Diffstat (limited to 'src/actions/tones.ts')
-rw-r--r--src/actions/tones.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/actions/tones.ts b/src/actions/tones.ts
index 7d85d1c..0f28612 100644
--- a/src/actions/tones.ts
+++ b/src/actions/tones.ts
@@ -1,6 +1,6 @@
"use server";
-import db from "@/lib/db";
+import pdb from "@/lib/db/prosodydb";
import { WordData } from "@/zoom/logic/types";
// Helper to extract tone from prosody - assuming prosody is an array of objects like [{tone: number}, ...]
@@ -10,8 +10,14 @@ const getTonesFromProsody = (prosody: any): number[] | null => {
}
return null;
};
-
export async function fetchWordsByToneAndSyllables(
+ tones: (string | null)[], // Array of tones, one for each syllable. null means any tone.
+) {
+ const res = pdb.fetchWordsByToneAndSyls(tones);
+ return res;
+}
+
+export async function fetchWordsByToneAndSyllables_gem(
syllableCount: number,
tones: (number | null)[], // Array of tones, one for each syllable. null means any tone.
): Promise<WordData | null> {