https://github.com/wesfly/frequency-analyzer
Text analyser
https://github.com/wesfly/frequency-analyzer
cryptography frequency-analysis frequency-analyzer text text-analysis
Last synced: about 2 months ago
JSON representation
Text analyser
- Host: GitHub
- URL: https://github.com/wesfly/frequency-analyzer
- Owner: wesfly
- Created: 2025-02-03T14:49:32.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-10T19:45:39.000Z (4 months ago)
- Last Synced: 2025-02-10T20:24:37.011Z (4 months ago)
- Topics: cryptography, frequency-analysis, frequency-analyzer, text, text-analysis
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Frequency Analyzer
### How to run
```bash
git clone https://github.com/wesfly/frequency-analyzer
cd frequency-analyzer
```
To use this script, simply save it as a Python file (e.g., `frequency_counter.py`) and run it:
```bash
python3 frequency_counter.py
```This Python script counts the frequency of each letter in a given string and displays the results in a dictionary format. Here's how it works:
1. **Input**: The user is prompted to enter a string of text.
2. **Alphabet Initialization**: A list containing all lowercase English letters (a-z) is defined.
3. **Counting Occurrences**: For each letter in the alphabet, the script counts how many times it appears in the input string and stores these counts in a list.
4. **Other Statistics**: The program calculates other useful statistics such as average sentence length.
5. **Results Display**: The script prints the total length of the input string and converts the counts into a dictionary where keys are letters (a-z) and values are their respective counts.### Features:
- The script handles both lowercase and uppercase letters by default (though it only counts lowercase).
- Non-letter characters are treated as separate entities with their own counts.
- The script does not modify the input string or change case.