mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-24 00:01:03 +08:00
Install some stuff.
This commit is contained in:
parent
f8879b307c
commit
004028d7b5
6
bun.lock
6
bun.lock
@ -8,6 +8,7 @@
|
|||||||
"@fontsource/fira-code": "^5.2.6",
|
"@fontsource/fira-code": "^5.2.6",
|
||||||
"@fontsource/fira-sans": "^5.2.5",
|
"@fontsource/fira-sans": "^5.2.5",
|
||||||
"@heroicons/vue": "^2.2.0",
|
"@heroicons/vue": "^2.2.0",
|
||||||
|
"@monyone/aho-corasick": "^1.0.4",
|
||||||
"@nuxt/image": "1.10.0",
|
"@nuxt/image": "1.10.0",
|
||||||
"@nuxtjs/i18n": "9.5.4",
|
"@nuxtjs/i18n": "9.5.4",
|
||||||
"@nuxtjs/robots": "5.2.10",
|
"@nuxtjs/robots": "5.2.10",
|
||||||
@ -17,7 +18,6 @@
|
|||||||
"@tailwindcss/vite": "^4.1.5",
|
"@tailwindcss/vite": "^4.1.5",
|
||||||
"@uploadthing/nuxt": "^7.1.7",
|
"@uploadthing/nuxt": "^7.1.7",
|
||||||
"@vueuse/core": "^13.1.0",
|
"@vueuse/core": "^13.1.0",
|
||||||
"ahocorasick": "^1.0.2",
|
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"argon2": "^0.43.0",
|
"argon2": "^0.43.0",
|
||||||
"axios": "^1.9.0",
|
"axios": "^1.9.0",
|
||||||
@ -327,6 +327,8 @@
|
|||||||
|
|
||||||
"@miyaneee/rollup-plugin-json5": ["@miyaneee/rollup-plugin-json5@1.2.0", "", { "dependencies": { "@rollup/pluginutils": "^5.1.0", "json5": "^2.2.3" }, "peerDependencies": { "rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" } }, "sha512-JjTIaXZp9WzhUHpElrqPnl1AzBi/rvRs065F71+aTmlqvTMVkdbjZ8vfFl4nRlgJy+TPBw69ZK4pwFdmOAt4aA=="],
|
"@miyaneee/rollup-plugin-json5": ["@miyaneee/rollup-plugin-json5@1.2.0", "", { "dependencies": { "@rollup/pluginutils": "^5.1.0", "json5": "^2.2.3" }, "peerDependencies": { "rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" } }, "sha512-JjTIaXZp9WzhUHpElrqPnl1AzBi/rvRs065F71+aTmlqvTMVkdbjZ8vfFl4nRlgJy+TPBw69ZK4pwFdmOAt4aA=="],
|
||||||
|
|
||||||
|
"@monyone/aho-corasick": ["@monyone/aho-corasick@1.0.4", "", {}, "sha512-e0BaPN1RE/eGXjXT/bwu8AAJtOnFxEKh/nDNnDixleD9N8citOKS4GBeGhxIP4OjFSnq6sQxRtb+RYBoYn1msg=="],
|
||||||
|
|
||||||
"@msgpackr-extract/msgpackr-extract-darwin-arm64": ["@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw=="],
|
"@msgpackr-extract/msgpackr-extract-darwin-arm64": ["@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw=="],
|
||||||
|
|
||||||
"@msgpackr-extract/msgpackr-extract-darwin-x64": ["@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw=="],
|
"@msgpackr-extract/msgpackr-extract-darwin-x64": ["@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw=="],
|
||||||
@ -885,8 +887,6 @@
|
|||||||
|
|
||||||
"agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="],
|
"agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="],
|
||||||
|
|
||||||
"ahocorasick": ["ahocorasick@1.0.2", "", {}, "sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA=="],
|
|
||||||
|
|
||||||
"ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="],
|
"ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="],
|
||||||
|
|
||||||
"algoliasearch": ["algoliasearch@5.25.0", "", { "dependencies": { "@algolia/client-abtesting": "5.25.0", "@algolia/client-analytics": "5.25.0", "@algolia/client-common": "5.25.0", "@algolia/client-insights": "5.25.0", "@algolia/client-personalization": "5.25.0", "@algolia/client-query-suggestions": "5.25.0", "@algolia/client-search": "5.25.0", "@algolia/ingestion": "1.25.0", "@algolia/monitoring": "1.25.0", "@algolia/recommend": "5.25.0", "@algolia/requester-browser-xhr": "5.25.0", "@algolia/requester-fetch": "5.25.0", "@algolia/requester-node-http": "5.25.0" } }, "sha512-n73BVorL4HIwKlfJKb4SEzAYkR3Buwfwbh+MYxg2mloFph2fFGV58E90QTzdbfzWrLn4HE5Czx/WTjI8fcHaMg=="],
|
"algoliasearch": ["algoliasearch@5.25.0", "", { "dependencies": { "@algolia/client-abtesting": "5.25.0", "@algolia/client-analytics": "5.25.0", "@algolia/client-common": "5.25.0", "@algolia/client-insights": "5.25.0", "@algolia/client-personalization": "5.25.0", "@algolia/client-query-suggestions": "5.25.0", "@algolia/client-search": "5.25.0", "@algolia/ingestion": "1.25.0", "@algolia/monitoring": "1.25.0", "@algolia/recommend": "5.25.0", "@algolia/requester-browser-xhr": "5.25.0", "@algolia/requester-fetch": "5.25.0", "@algolia/requester-node-http": "5.25.0" } }, "sha512-n73BVorL4HIwKlfJKb4SEzAYkR3Buwfwbh+MYxg2mloFph2fFGV58E90QTzdbfzWrLn4HE5Czx/WTjI8fcHaMg=="],
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
// Trying out the ahocorasick algorithm
|
// Trying out the ahocorasick algorithm
|
||||||
// Recommended by: https://www.threads.com/@hsinspeng/post/DJ3yVGQxBg7
|
// Recommended by: https://www.threads.com/@hsinspeng/post/DJ3yVGQxBg7
|
||||||
import AhoCorasick from "ahocorasick";
|
import { AhoCorasick } from "@monyone/aho-corasick";
|
||||||
|
|
||||||
async function checkUnsafeContent(title: string) {
|
async function checkUnsafeContent(title: string) {
|
||||||
try {
|
try {
|
||||||
const req = await fetch("/api/contentcheck/kidunfriendlycontent");
|
const req = await fetch("/api/contentcheck/kidunfriendlycontent");
|
||||||
const res = await req.json();
|
const res = await req.json();
|
||||||
console.log(res.words);
|
console.log(res);
|
||||||
const ac = new AhoCorasick(res.words);
|
const ac = new AhoCorasick(res.words);
|
||||||
const kidfriendly = ac.search(title);
|
const kidfriendly = ac.hasKeywordInText(title);
|
||||||
console.log(kidfriendly);
|
console.log(kidfriendly);
|
||||||
return kidfriendly;
|
return kidfriendly;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"@fontsource/fira-code": "^5.2.6",
|
"@fontsource/fira-code": "^5.2.6",
|
||||||
"@fontsource/fira-sans": "^5.2.5",
|
"@fontsource/fira-sans": "^5.2.5",
|
||||||
"@heroicons/vue": "^2.2.0",
|
"@heroicons/vue": "^2.2.0",
|
||||||
|
"@monyone/aho-corasick": "^1.0.4",
|
||||||
"@nuxt/image": "1.10.0",
|
"@nuxt/image": "1.10.0",
|
||||||
"@nuxtjs/i18n": "9.5.4",
|
"@nuxtjs/i18n": "9.5.4",
|
||||||
"@nuxtjs/robots": "5.2.10",
|
"@nuxtjs/robots": "5.2.10",
|
||||||
@ -29,7 +30,6 @@
|
|||||||
"@tailwindcss/vite": "^4.1.5",
|
"@tailwindcss/vite": "^4.1.5",
|
||||||
"@uploadthing/nuxt": "^7.1.7",
|
"@uploadthing/nuxt": "^7.1.7",
|
||||||
"@vueuse/core": "^13.1.0",
|
"@vueuse/core": "^13.1.0",
|
||||||
"ahocorasick": "^1.0.2",
|
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"argon2": "^0.43.0",
|
"argon2": "^0.43.0",
|
||||||
"axios": "^1.9.0",
|
"axios": "^1.9.0",
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import CheckKidUnfriendlyContent from "~/components/checks/checkKidUnfriendlyContent";
|
|
||||||
const title = ref("");
|
|
||||||
const system = ref("");
|
|
||||||
const checkTitle = async () => {
|
|
||||||
if (!title.value) return;
|
|
||||||
system.value = await CheckKidUnfriendlyContent(title.value);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<div
|
|
||||||
class="flex flex-col absolute h-screen w-full inset-0 justify-center align-center text-center"
|
|
||||||
>
|
|
||||||
<h1 class="text-4xl m-2">標體?</h1>
|
|
||||||
<div class="flex flex-row justify-center align-center gap-2">
|
|
||||||
<input type="text" class="text-black rounded-xl p-2 w-[300px]" />
|
|
||||||
<button @click="checkTitle" class="rounded-xl bg-sky-600 p-2">
|
|
||||||
Find
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div>{{ system }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="h-screen"></div>
|
|
||||||
</template>
|
|
@ -2,10 +2,9 @@
|
|||||||
import CheckKidUnfriendlyContent from "~/components/checks/checkKidUnfriendlyContent";
|
import CheckKidUnfriendlyContent from "~/components/checks/checkKidUnfriendlyContent";
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
const system = ref(false);
|
const system = ref(false);
|
||||||
const testingReturn = ref("");
|
|
||||||
const checkTitle = async () => {
|
const checkTitle = async () => {
|
||||||
if (!title.value) return;
|
if (!title.value) return;
|
||||||
testingReturn.value = await CheckKidUnfriendlyContent(title.value);
|
system.value = await CheckKidUnfriendlyContent(title.value);
|
||||||
};
|
};
|
||||||
useSeoMeta({
|
useSeoMeta({
|
||||||
title: "這個文章是不是使用偏色情的標體?",
|
title: "這個文章是不是使用偏色情的標體?",
|
||||||
@ -17,7 +16,11 @@ useSeoMeta({
|
|||||||
>
|
>
|
||||||
<h1 class="text-4xl m-2">這個文章是不是使用偏色情的標體?</h1>
|
<h1 class="text-4xl m-2">這個文章是不是使用偏色情的標體?</h1>
|
||||||
<div class="flex flex-row justify-center align-center gap-2">
|
<div class="flex flex-row justify-center align-center gap-2">
|
||||||
<input type="text" class="text-black rounded-xl p-2 w-[300px]" />
|
<input
|
||||||
|
type="text"
|
||||||
|
class="text-black rounded-xl p-2 w-[300px]"
|
||||||
|
v-model="title"
|
||||||
|
/>
|
||||||
<button @click="checkTitle" class="rounded-xl bg-sky-600 p-2">
|
<button @click="checkTitle" class="rounded-xl bg-sky-600 p-2">
|
||||||
Find
|
Find
|
||||||
</button>
|
</button>
|
||||||
@ -25,6 +28,5 @@ useSeoMeta({
|
|||||||
<span v-if="system" class="text-red-400 text-8xl m-8">是</span>
|
<span v-if="system" class="text-red-400 text-8xl m-8">是</span>
|
||||||
<span v-else class="text-white">不是</span>
|
<span v-else class="text-white">不是</span>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ testingReturn }}</div>
|
|
||||||
<div class="h-screen"></div>
|
<div class="h-screen"></div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user