From 61a5c1cb09bacaa240312f0c8698c406b74c3767 Mon Sep 17 00:00:00 2001 From: Sherry Yong Chen Date: Tue, 9 Mar 2021 15:41:56 -0500 Subject: [PATCH] Update parts_of_speech.py --- backend/app/analysis/parts_of_speech.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/app/analysis/parts_of_speech.py b/backend/app/analysis/parts_of_speech.py index 298a067..74d8667 100644 --- a/backend/app/analysis/parts_of_speech.py +++ b/backend/app/analysis/parts_of_speech.py @@ -168,7 +168,13 @@ def get_parts_of_speech_tags(text): 'noun': ['NN', 'NNS', 'NNP', 'NNPS'], 'verb': ['VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ'], 'adverb': ['RB', 'RBR', 'RBS'], - 'adjective': ['JJ', 'JJR', 'JJS'] + 'adjective': ['JJ', 'JJR', 'JJS'], + 'adposition': ['IN', 'TO', 'PRT'], + 'conjunctive': ['CC', 'CONJ'], + 'pronouns': ['PRP', 'PRON'], + 'determiner': ['DT', 'DET'], + 'numeral': ['NUM'], + 'other': ['X'] } @@ -262,7 +268,7 @@ def punct_in_word(word): """ Checks if there are punctuations in the word """ - quotes = ["“", '"', "'", "’", ".", "?", "!"] + quotes = ["“", '"', "'", "’", ".", "?", "!", ":", ";", "-", ","] for quote in quotes: if quote in word: return True