Application to Google Maps
With NLP having such wide applications, I actually tried to write code and implement it. When we enter the source and destination in the google maps, we get various routes containing directions. Therefore in a particular route, if I want to see a whether a particular road is closed or not, we can check it by using ‘re’ package in python. The search function of ‘re’ will take pattern and the text as input. So if my search function is re.search(“5th.+closed”,route), it will search whether ‘5th’ and ‘closed’ appear in same sentence or not. If they appear together in a sentence, then it will return a positive match. Similarly we can search for other combinations also.
I have written code for one route only. Link to code: https://github.com/SimpleProgramming1/Regular-Expressions-Functions
This can be extended to other routes as well. We just need to copy texts of other routes. If I want to check whether I want to go from A-R-F train combination. I will include that in my search pattern.
Link to the entire video
By: Parth Parekh