indexer and searcher
Budget: $250 – $750 USD
have a already made project i want some more features and changes to it the project is a text files indexer and searcher which receives a path from the user to a directory that have N number of text files the program will invert index these files and then the user will be able to search on these files. the changes and the features are these Changes in the current code:
1-The naming of the indexed file should not be A udid with any random words The name must be as the indexed directory name +”indexedfile” and when the user runs the indexer it must prints the path of the index file and the directory name where it is saved
2-separate abstract classes files from sub classes like the indexer file have the abstract class indexer in it and the implementation class inverted _indexer in it separate these into two files.
3-Merge the method retrieve_log_files with the method read_files in the reader so we’ll call only one of them in the command parser
4-in the indexer It is not clean to keep opening config file in each class that needs to do it, when path/name of file changes you will need to update all related classes, in addition to that you are opening config file multiple times. Read it in main instead and pass it as object for all classes that needs it instead, this applies to reader as well.
5-It is not preferred to use concatenation for multiple strings inside loop use join instead, in the indexer apply_preproccessing method
6-if os.name == 'posix' self.dir_path = dir_path if dir_path.endswith("/") else dir_path + "/" elif os.name == 'nt': self.dir_path = dir_path if dir_path.endswith("\\") else dir_path + "\\" else: print("Unrecognized OS. Exiting.") This is duplicated code and used also in the reader, please parser this into a util class instead
7-in point 6 when an Unrecognized Os.Exsiting happens or any print massage that mean there is an error , Make these Raise and Exception with the massage already used ( use exception handling )
8-When a user chooses a directory to index there must a checking stage So if I choose directory A to index ill save the last date modified for it so after a time ex: 6 hours If I re-choose directory A and see that the dates and hours are the same I’ll tell the user it’s already indexed
9-The searching part must have to choices Choice 1: default searching which is searching on all the indexed files or a merged one (choose what’s best) Choice
2: Choose the indexed directory name not the index file name so that’s why change number one is important so let’s say I choose choice number two I just indexed a Directory with the name Laptopsales So I enter the directory name laptopsales and we will just add to it the word “indexedfile” and find its index file and search on it
10-the main should run on a loop obviously.
11-unit testing must be added and modified 2 unit test classes with using of mocks Test_indexer Test_searcher
Features to be added:
will be sent in the chat
link to the code: https://drive.google.com/file/d/1KRsqgcGj4ZA6eILNCmlg_368v2L_QkVH/view?usp=drivesdk
1-The naming of the indexed file should not be A udid with any random words The name must be as the indexed directory name +”indexedfile” and when the user runs the indexer it must prints the path of the index file and the directory name where it is saved
2-separate abstract classes files from sub classes like the indexer file have the abstract class indexer in it and the implementation class inverted _indexer in it separate these into two files.
3-Merge the method retrieve_log_files with the method read_files in the reader so we’ll call only one of them in the command parser
4-in the indexer It is not clean to keep opening config file in each class that needs to do it, when path/name of file changes you will need to update all related classes, in addition to that you are opening config file multiple times. Read it in main instead and pass it as object for all classes that needs it instead, this applies to reader as well.
5-It is not preferred to use concatenation for multiple strings inside loop use join instead, in the indexer apply_preproccessing method
6-if os.name == 'posix' self.dir_path = dir_path if dir_path.endswith("/") else dir_path + "/" elif os.name == 'nt': self.dir_path = dir_path if dir_path.endswith("\\") else dir_path + "\\" else: print("Unrecognized OS. Exiting.") This is duplicated code and used also in the reader, please parser this into a util class instead
7-in point 6 when an Unrecognized Os.Exsiting happens or any print massage that mean there is an error , Make these Raise and Exception with the massage already used ( use exception handling )
8-When a user chooses a directory to index there must a checking stage So if I choose directory A to index ill save the last date modified for it so after a time ex: 6 hours If I re-choose directory A and see that the dates and hours are the same I’ll tell the user it’s already indexed
9-The searching part must have to choices Choice 1: default searching which is searching on all the indexed files or a merged one (choose what’s best) Choice
2: Choose the indexed directory name not the index file name so that’s why change number one is important so let’s say I choose choice number two I just indexed a Directory with the name Laptopsales So I enter the directory name laptopsales and we will just add to it the word “indexedfile” and find its index file and search on it
10-the main should run on a loop obviously.
11-unit testing must be added and modified 2 unit test classes with using of mocks Test_indexer Test_searcher
Features to be added:
will be sent in the chat
link to the code: https://drive.google.com/file/d/1KRsqgcGj4ZA6eILNCmlg_368v2L_QkVH/view?usp=drivesdk