mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Link the checks into the code & made a basic news summary system
This commit is contained in:
parent
aea658a4cb
commit
f3204cb574
6 changed files with 51 additions and 20 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue