import { useState, useEffect } from "react"; import { Textarea } from "@/components/ui/textarea"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { Loader2 } from "lucide-react"; import { motion } from "framer-motion"; export default function AIProofreadingTool() { const [text, setText] = useState(""); const [loading, setLoading] = useState(false); const [correctedText, setCorrectedText] = useState(""); const [rewrittenText, setRewrittenText] = useState(""); const [wordCount, setWordCount] = useState({}); const [searchWord, setSearchWord] = useState(""); const [foundWords, setFoundWords] = useState([]); const [keywords, setKeywords] = useState([]); useEffect(() => { setTimeout(() => { setLoading(false); }, 2000); }, []); const handleProofread = async () => { setLoading(true); setCorrectedText( text.replace(/\bteh\b/g, "the").replace(/\brecieve\b/g, "receive") ); setLoading(false); }; const handleRewrite = async () => { setLoading(true); setRewrittenText( "Here is a rewritten version of your text: " + text.split(" ").reverse().join(" ") ); setLoading(false); }; const handleWordCount = () => { const words = text.split(/\s+/).filter(word => word); const count = {}; words.forEach(word => { count[word] = (count[word] || 0) + 1; }); setWordCount(count); }; const handleWordSearch = () => { if (!searchWord) return; const regex = new RegExp(`\\b${searchWord}\\b`, "gi"); const matches = text.match(regex) || []; setFoundWords(matches); }; const handleKeywordExtraction = () => { const commonWords = new Set(["the", "is", "in", "and", "to", "of", "a", "that", "it", "on", "for", "with", "as", "was", "at", "by", "an", "be", "this", "which", "or", "from", "but", "not", "are", "we", "they", "you", "he", "she", "my", "our", "their"]); const words = text.split(/\s+/).filter(word => word && !commonWords.has(word.toLowerCase())); const uniqueKeywords = Array.from(new Set(words)); setKeywords(uniqueKeywords); }; return (

AI Proofreading, Rewriting, Word Counter, Word Finder & Keyword Extractor

Search This Blog

About Us

About Us
Field Selectors - Empowering Your Career Choices Field Selectors is a comprehensive platform dedicated to guiding students and professionals in making informed career decisions. Our mission is to provide valuable insights, resources, and opportunities, focusing on a variety of career fields and educational scholarships. Whether you’re exploring potential career paths, looking for scholarship opportunities, or seeking personalized guidance, Field Selectors serves as a one-stop destination to unlo

Footer Copyright

Design by - Blogger Templates | Distributed by Free Blogger Templates

Top Videos

megagrid/recent

Comments

4/comments/show

Trending Weekly

4/sgrid/recent

Pages

Most Recent

4/sidebar/recent

What's New

block/recent