RE: Mini Project: Implementing a Search Engine with C Plus Plus

You are viewing a single comment's thread from:

Mini Project: Implementing a Search Engine with C Plus Plus

in techclub •  16 hours ago 

Hi @ahsansharif, Thanks for participating in the Technology and Development Club using our tag #techclub and #techclub-s23w1.


Nice to see a mini project in C++ language. Search engines are used in our daily life and they are based on the large models.

You have written the search engine in a great way while managing the file opening if the file is not opening with the help of the ifstream.

Your basic functionality for this search engine is correct to search in the file. The program allows the users to enter the query dynamically.

Areas of Improvements:

  • You should implement a case- insensitive search function because your current function is case sensitive and if you currently search Hello it will not consider hello. So implementing case-insensitive search function can help us to solve this problem.

#include < algorithm >
string toLowerCase(const string& str) {
string lowerStr = str;
transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), ::tolower);
return lowerStr;
}

  • It is how you can implement case-insensitive in your search function.

  • The program searches for substrings instead of whole words. For example when you search for the the program will also match there or these. On the other hand if you use regular expressions or istringstream to tokenize the words then it can help to solve this problem as well.

  • On the other hand you can further improve the performance of your search function by implementing memory mapping because checking line by line will consume a lot of resources.


Overall you have tried your best to develop a search engine using C++. Pay heed to the suggestions and continue to improve your work.


Plagiarism Free
#steemexclusive
AI Free

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you so much for the verification and the valuable feedback. I will try my best to improve.

You are welcome.