Link the checks into the code & made a basic news summary system

This commit is contained in:
yuanhau 2025-05-25 18:00:14 +08:00
parent aea658a4cb
commit f3204cb574
6 changed files with 51 additions and 20 deletions

View file

@ -6,11 +6,9 @@ async function checkUnsafeContent(title: string) {
try {
const req = await fetch("/api/contentcheck/kidunfriendlycontent");
const res = await req.json();
console.log(res);
const ac = new AhoCorasick(res.words);
const kidfriendly = ac.hasKeywordInText(title);
console.log(kidfriendly);
return kidfriendly;
return kidfriendly;
} catch (e) {
console.log(e);
}