Level: Beginner
I couldnt figure out how to handle abbreviations (Dr., St., etc) without using an nlp model like spacy or nltk. Is there a simpler approach?
How about creating a list of common abbreviations and then checking if a word that ends with "." is contained in the abbreviations list and if not, it is the last word of a sentence.
abbreviations = {"dr.", "mr.", "mrs.", "ms.", "st.", "etc.", "e.g.", "i.e.", "vs."}
Good point. Looking into it there’s <100 English abbreviations and contractions. Not as bad as I initially thought.
I couldnt figure out how to handle abbreviations (Dr., St., etc) without using an nlp model like spacy or nltk. Is there a simpler approach?
How about creating a list of common abbreviations and then checking if a word that ends with "." is contained in the abbreviations list and if not, it is the last word of a sentence.
abbreviations = {"dr.", "mr.", "mrs.", "ms.", "st.", "etc.", "e.g.", "i.e.", "vs."}
Good point. Looking into it there’s <100 English abbreviations and contractions. Not as bad as I initially thought.