How would a parsers know the difference between punctuations in a url or handle vs those at the end of sentences

Week 1
When creating a post, please add:

@YMourri and @AndrewYNg are tuning a GREAT AI model at https://deeplearning.ai!!!

In the above sentence how would a program decide to remove ! at the end, but not @, :, \, or . in stop words and punctuation phase.

@Sriram_Kollipara for a given set of characters you can add a positive look ahead assertion: (?=\s|$) to your REGEX.

Think of an assertion as a restriction. ā€˜?=ā€™ implements the assertion ā€˜\sā€™ is a whitespace, the pipe ā€˜|ā€™ stands for or, and ā€˜$ā€™ is end of sentence.

1 Like