Skip to content

Analyze the frequency of words in a text and download the results in JSON format.

Notifications You must be signed in to change notification settings

AmirhosseinDotZip/wfa3.0

Repository files navigation

Word Frequency Analyzer

ambient-work - WFA3.0 Extrempty - Dev Made with - Next JS in - Development

Analyze the frequency of words in a text and download the results in JSON format.

🚀 in development, contributions are welcome

Demo video
wfa3-pages-demo.mp4

Quickstart

To get started:

  1. Clone this repository.
  2. Navigate to the project folder and run npm install to install the dependencies.
  3. Run npm run dev to start the development server.
  4. Open your browser and navigate to http://localhost:3000.

What's inside?

This project uses Next.js for server-side rendering and React for building the user interface. The main component in this project is Analyzer, which renders a form with a textarea input and two buttons: one to analyze the text in the input, and another to download the results in JSON format.

The countWords function takes a string of text as input and returns an object with key-value pairs where the keys are individual words in the text and the values are the frequency of each word. When the user submits the form, the handleSubmit function is called, which uses the countWords function to count the frequencies of the words in the input text and sets the results state using the setResults function.

If there are results, the component renders a grid of boxes displaying each word and its frequency. When the user clicks the download button, the handleDownload function creates a temporary anchor link with a data: URI containing the JSON-encoded results data, sets the download attribute to a filename based on the current date and time, triggers a click event on the anchor link, and then removes the anchor element from the DOM.

License

This project is licensed under the MIT license.


Made with ❤️ by Baniminator

About

Analyze the frequency of words in a text and download the results in JSON format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published