Skip to content

AbdeChk/Zipf-s-Law

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zipf's Law Analyzer

A simple web application to test whether a text follows Zipf's Law.

Users can paste text or upload a .txt file, then visualize word frequencies with a chart and ranked table.


Features

  • Upload .txt files
  • Paste custom text
  • Word frequency analysis
  • Interactive chart
  • Logarithmic / linear scale toggle
  • Zipf coefficient calculation
  • Top ranked words table

Technologies

  • HTML
  • CSS
  • JavaScript
  • Chart.js
  • MathJax

How to Use

  1. Visit Zipf-s-Law
  2. Paste text or upload a .txt file
  3. Click Analyze
  4. View the chart and results table

Run Locally(optinal)

You can open the file directly in your browser:

index.html

Or start a local server:

python3 -m http.server

Then open:

http://localhost:8000

About Zipf's Law

Zipf's Law states that the frequency of a word is inversely proportional to its rank:

$$f(r) = \frac{1}{r^s}$$

This behavior appears in many natural language texts.


Limits

  • Maximum: 10,000 words
  • Only .txt files supported

License

Free to use for educational and research purposes.

About

Zipf's law

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors