Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
simples_sto = unique_term in self.stopword_set
if unique_term.endswith('s') and len(unique_term) > 3:
unique_term = unique_term[:-1]
if unique_term in self.terms:
return self.terms[unique_term]
# Include this part
simples_unique_term = unique_term
for pontuation in self.exclude:
simples_unique_term = simples_unique_term.replace(pontuation, '')
# until here
isstopword = simples_sto or unique_term in self.stopword_set or len(simples_unique_term) < 3
term_id = len(self.terms)
term_obj = single_word(unique_term, term_id, self.G)
term_obj.stopword = isstopword
if save_non_seen:
self.G.add_node(term_id)
self.terms[unique_term] = term_obj
return term_obj