A Text Analyzer application written in F# that analyzes text and reports useful metrics such as word count, sentence count, paragraph count, top words, and average sentence length. The application features a Windows Forms GUI, stores analysis history in a SQLite database, and supports exporting results to JSON files.
-
Text Input
- Manually enter text
- Load text from
.txtfiles
-
Text Analysis Metrics
- Word count
- Sentence count
- Paragraph count
- Top words with frequency
- Average sentence length
-
GUI Interface
- Interactive Windows Forms interface for easy usage
-
History Tracking
- All analyses are saved in a SQLite database
-
Export Reports
- Save analysis results as JSON files
-
Modular Design
- Easily extendable with additional metrics or analysis features
TextAnalyzer/
│
├─ src/ # Source code
│ ├─ DB.fs # Database management
│ ├─ FileIO.fs # JSON export
│ ├─ Frequency.fs # Top word calculation
│ ├─ InputHandling.fs # Load text from file or manual input
│ ├─ Metrics.fs # Text metrics calculation
│ ├─ Tokenization.fs # Split text into words, sentences, paragraphs
│ ├─ Types.fs # Data types (AnalysisReport)
│ ├─ UI.fs # Windows Forms GUI
│ ├─ Program.fs # Entry point
│ └─ TextAnalyzer.fsproj
│
├─ test/ # Test project
│ ├─ ManualTests.fs # Manual test cases
│ └─ TextAnalyzerTests.fsproj
│
├─ bin/ # Build output (ignored in Git)
├─ obj/ # Build artifacts (ignored in Git)
└─ README.md # Project overview and instructions
- .NET 8 SDK
- Windows OS (required for Windows Forms GUI)
- Optional: Visual Studio or VS Code for F# development
- Clone the repository
git clone https://github.com/kinzy4/TextAnalyzer.git
cd TextAnalyzer/src- Build and run the project
dotnet build
dotnet run- Use the GUI to:
- Type or paste text into the input box
- Click Analyze to view metrics
- Click Export JSON to save results
- Click Load File to import a
.txtfile - Click View History to see previous analyses
Navigate to the test folder:
cd ../test
dotnet runThe console will display which tests passed or failed.
Input Text:
Hello world! This is a test.
Text Analyzer should count words, sentences, paragraphs, and top words.
Text Analyzer should count words, sentences, paragraphs, and top words.
Analysis Output:
- Words: 15
- Sentences: 3
- Paragraphs: 1
- Top Words:
text (2),analyzer (2),hello (1), ... - Average Sentence Length: 5.0
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature- Commit your changes:
git commit -m "feat: add new feature"- Open a Pull Request
This project is licensed under the MIT License.
- Microsoft.Data.Sqlite for database integration
- Newtonsoft.Json for JSON serialization
- F# and .NET community for support and resources