File Similarity Checker is a high-performance Spring Boot application designed to analyze and compare text files with precision and speed. Built with clean architecture principles, it provides a robust RESTful API for calculating similarity scores between a reference file and multiple target files.
In today's digital world, comparing documents for similarity is crucial for:
- Academic Integrity - Detect plagiarism in student submissions
- Content Management - Identify duplicate content across documents
- Quality Assurance - Find similar bug reports or support tickets
- Data Analysis - Group similar documents for classification
- Legal Compliance - Compare contracts and legal documents
- Input - Provide a reference text file and a directory of files to compare
- Processing - Extract and normalize words from all files
- Analysis - Calculate similarity scores using intelligent algorithms
- Output - Get detailed JSON response with similarity percentages
|
|
-
GET /api/v1/similarity/compare- Compares all files in the directory to the reference file and returns similarity scores.
-
GET /api/v1/similarity/top/{count}- Returns the top {count} files with the highest similarity scores to the reference file.
{
"referenceFile": "reference.txt",
"totalFilesCompared": 5,
"results": [
{
"fileName": "exact-match.txt",
"score": 100.0,
"matchedWords": 521,
"totalReferenceWords": 521,
"similarityPercentage": "100.0%"
},
{
"fileName": "high-match.txt",
"score": 64.3,
"matchedWords": 335,
"totalReferenceWords": 521,
"similarityPercentage": "64.3%"
},
{
"fileName": "medium-match.txt",
"score": 25.14,
"matchedWords": 131,
"totalReferenceWords": 521,
"similarityPercentage": "25.14%"
},
{
"fileName": "low-match.txt",
"score": 16.7,
"matchedWords": 87,
"totalReferenceWords": 521,
"similarityPercentage": "16.7%"
},
{
"fileName": "no-match.txt",
"score": 0.0,
"matchedWords": 0,
"totalReferenceWords": 521,
"similarityPercentage": "0.0%"
}
],
"executionTime": "1 ms",
"bestMatch": "exact-match.txt"
}-
Multi-language Support: Allow similarity checks for documents in multiple languages. This will enable the tool to process files written in different languages and enhance its applicability in multilingual environments.
-
Custom Algorithms: Add support for user-defined comparison algorithms. Users will be able to implement their own algorithms to be used within the tool, providing flexibility and customization for specialized needs.
-
Real-time Updates: WebSocket integration for real-time report updates. This will allow users to receive live updates on similarity checks, improving the responsiveness and interactivity of the application.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/featureX) - Commit your changes (
git commit -m 'Add some featureX') - Push to the branch (
git push origin feature/featureX) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
