https://github.com/cotneo/dictionary_c-
This project is c# study
https://github.com/cotneo/dictionary_c-
Last synced: 10 months ago
JSON representation
This project is c# study
- Host: GitHub
- URL: https://github.com/cotneo/dictionary_c-
- Owner: CotNeo
- Created: 2025-08-03T23:30:02.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-03T23:38:08.000Z (11 months ago)
- Last Synced: 2025-08-04T01:36:18.917Z (11 months ago)
- Language: C#
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CEFR Word Fetcher (C# + WordsAPI)
A SOLID-principled C# console application to:
* Load CEFR-level vocabulary from a dataset
* Randomly select 10 words (optionally by level)
* Fetch definitions and usage examples using WordsAPI
* Output to console or save as JSON
## ๐ Technologies
* C# (.NET 8.0)
* HttpClient
* CSV parsing (CsvHelper)
* JSON serialization (Newtonsoft.Json)
* SOLID Principles implementation
## ๐ Project Structure
```
CEFRWordFetcher/
โโโ CEFRWordFetcher.sln
โโโ /CEFRWordFetcher.Core # Domain models and interfaces
โ โโโ Models/
โ โ โโโ CEFRWord.cs
โ โ โโโ WordInfo.cs
โ โโโ Interfaces/
โ โ โโโ IWordSelector.cs
โ โ โโโ IWordsApiService.cs
โ โโโ Services/
โ โโโ RandomWordSelector.cs
โ
โโโ /CEFRWordFetcher.Infrastructure # Data loading (CSV)
โ โโโ CsvLoader.cs
โ
โโโ /CEFRWordFetcher.Api # WordsAPI HTTP service
โ โโโ WordsApiService.cs
โ
โโโ /CEFRWordFetcher.ConsoleApp # Main app (UI entry point)
โ โโโ Program.cs
โ
โโโ /data
โ โโโ cefr_dataset.csv
โโโ /output
โ โโโ output.json
```
## ๐งช SOLID Principles Applied
| Principle | Implementation |
|-----------|----------------|
| **S - Single Responsibility** | Each class has one job (API, CSV loading, word selection, etc.) |
| **O - Open/Closed** | New word selectors can be added without modifying existing code |
| **L - Liskov Substitution** | Interfaces can be mocked or replaced with different implementations |
| **I - Interface Segregation** | Small, focused interfaces like `IWordsApiService`, `IWordSelector` |
| **D - Dependency Inversion** | Main app depends on abstractions, not concrete implementations |
## โถ๏ธ Usage
### Basic Usage
```bash
dotnet run --project CEFRWordFetcher.ConsoleApp
```
### Filter by CEFR Level
```bash
dotnet run --project CEFRWordFetcher.ConsoleApp -- --level=A1
dotnet run --project CEFRWordFetcher.ConsoleApp -- --level=B2
```
## ๐ WordsAPI Setup
1. Sign up: [https://rapidapi.com/dpventures/api/wordsapi](https://rapidapi.com/dpventures/api/wordsapi)
2. Set your API key: `export WORDS_API_KEY="your_api_key_here"`
3. Run the application to fetch detailed word information
## ๐ License
Maintenance, Author Cotneo