Open AvishrantsSh opened 3 years ago
@AvishrantsSh Thank you very much, sir. Sir, your feedback and recommendations are really valuable to us. We are grateful to you for your assistance to newcomers like us. We'll take a look at your suggestions and try to put them into action as quickly as feasible. We look forward to receiving your advice in the future also.
The project you are working on is frankly great!
A nice little tweak might be to add all the explicit words in a separate file to enhance readability. Also, considering that the set of words might get quite large, I think you can consider storing the words in either
JSON
format or aset
object. These two data structures are hashed and offer O(1) lookup, which is pretty neat I guess.Another suggestion would be to construct regex in one go rather than constructing for each word in the array. Also, the current method does a regex match for every single word again and again, which might not be very efficient perhaps.
Hope it helps @lkiThakur @ktsrivastava29