TextFilterApp is a C# .NET Core console application designed to apply multiple text filters on strings read from a text file. It demonstrates the use of asynchronous programming, dependency injection, and the application of design patterns to create a scalable and maintainable solution.
- Read Text File: Reads input from a specified text file.
- Apply Filters: Filters out words based on three criteria:
- Words with a vowel in the middle.
- Words shorter than three characters.
- Words containing the letter 't'.
- Asynchronous Processing: Processes text files in chunks asynchronously for improved performance.
- Modular Design: Utilizes dependency injection and interface-based design for easy extension and maintenance.
Ensure you have the following installed:
- .NET 8.0 SDK or later
- Clone the repository to your local machine:
git clone https://github.com/Hussamalsh/TextFilterApp.git
- Navigate to the project directory:
cd TextFilterApp
- Modify the
appsettings.json
file to specify the path to the input text file and adjust filter settings if necessary.
- Build the application:
dotnet build
- Run the application:
dotnet run
The application is executed from the command line and does not require any arguments. It reads the configuration from appsettings.json
, processes the specified text file, and outputs the filtered text to the console.
To add a new text filter:
- Implement the
IFilterStrategy
interface in a new class under theFilters
directory. - Register the new filter in
HostConfiguration.cs
by adding it to the list of filters in theTextFilter
service configuration.
While the TextFilterApp serves its purpose well, there's always room for growth and enhancement. Here are a few areas we're looking to improve in the future:
- Performance Optimization: Although the app currently processes files in chunks asynchronously, we aim to further optimize performance, especially for very large files. This could involve more sophisticated asynchronous processing techniques or leveraging parallel computing where appropriate.
- Expanded File Support: Currently, the application reads from text files. Expanding this to include other file types, such as PDFs or Word documents, would greatly increase its utility.
- Adding Logging: we can add logging to the application to help with debugging and monitoring.
- Adding Documentation: We can add more documentation and comments to the code to make it easier for developers to understand and contribute to the project.
Contributions are welcome! Please feel free to submit pull requests with new features, improvements, or bug fixes.
❤️ Hussam ❤️