QNLP  v1.0
__init__.py
Go to the documentation of this file.
1 name = "tagging"
2 import nltk
3 import sys
4 import numpy as np
5 
6 from collections import Counter
7 from nltk.corpus import stopwords
8 
9 from QNLP.tagging.word_types import Noun
10 from QNLP.tagging.word_types import Verb
11 from QNLP.tagging.word_types import Sentence
12 
14 
15 __all__ = ["word_types","tag_file"]
16 
17 """
18 Reduces the nltk/spacy types to simplified types defined above
19 """
20 def matchables(classType, tag):
21  if isinstance(classType, Noun) or classType is Noun:
22  return tag in ["NN","NNS","NNP","NNPS","NOUN", "PROPN"]
23  elif isinstance(classType, Verb) or classType is Verb:
24  return tag in ["VB", "VBD", "VBG", "VBN", "VBP", "VBZ","VERB"]
25  else:
26  return False
def matchables(classType, tag)
Definition: __init__.py:20