Skip to content

lorenzo-d-m/letter-frequency-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Letter Frequency Test

A C# program that analyzes character frequency in text files and displays them in descending order of occurrence.

Overview

This script reads a text file (in this case, harry-potter.txt) and counts the occurrences of each character, then outputs the results sorted by frequency from most to least common.

Requirements

  • .NET SDK (10.0 or later recommended)
  • A text file named harry-potter.txt in the same directory as the script

Usage

Run the script using the dotnet script runner:

dotnet LetterFrequencyTest.cs

Or make it executable:

chmod +x LetterFrequencyTest.cs
./LetterFrequencyTest.cs

Output Format

The script outputs each character with its rank and occurrence count:

# 1 - char: [space] - occurrences: 150000
# 2 - char: e - occurrences: 95000
# 3 - char: t - occurrences: 70000
...

About

Analyzes the frequency with which a character appears in a text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages