-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocument.py
More file actions
83 lines (64 loc) · 2.5 KB
/
document.py
File metadata and controls
83 lines (64 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
class Document:
"""Sets and Retrieves Text and Mentions"""
def __init__(self):
self.__text = ""
self.__textPath = ""
self.__mentionClustersList = []
self.__apposDict = {}
self.__copDict = {}
self.__mentionToClusterMap = {}
self.__parserObj = None
self.__NERMap = {}
self.__NERSet = set([])
def setText(self, string):
"""Adds the text to the object"""
self.__text = string
def getText(self):
"""Retrieves text from the object"""
return self.__text
def setTextPath(self, string):
"""Updates the path of input text file"""
self.__textPath = string
def getTextPath(self):
"""Retrieves the path of the input text file"""
return self.__textPath
def setMentionClustersList(self, mentionClustersList):
"""Updates the mention clusters list of the document"""
self.__mentionClustersList = mentionClustersList
def getMentionClustersList(self):
"""Retrieves mention cluster list from the object"""
return self.__mentionClustersList
def setFeatures(self, apposDict, copDict):
"""Adds feature relationship in the form of dictionary"""
self.__apposDict = apposDict
self.__copDict = copDict
def getAppositiveRelations(self):
"""Retrieves indices related as appositives"""
return self.__apposDict
def getCopulativeRelations(self):
"""Retrieves indices related as copulatives"""
return self.__copDict
def setMentionToClusterMap(self, mentionToClusterMap):
"""Updates the map from mentions to the clusters they belong"""
self.__mentionToClusterMap = mentionToClusterMap
def getMentionToClusterMap(self):
"""Retrieves a map from the mentions to the clusters they belong"""
return self.__mentionToClusterMap
def setParserObject(self, parserObj):
"""Sets parserObj"""
self.__parserObj = parserObj
def getParserObject(self):
"""Returns parserObj"""
return self.__parserObj
def setNERMap(self, NERMap):
"""Sets NERMap"""
self.__NERMap = NERMap
def getNERMap(self):
"""Returns NERMap"""
return self.__NERMap
def setNESet(self, NERSet):
"""Sets NERSet"""
self.__NERSet = NERSet
def getNESet(self):
"""Returns NERSet"""
return self.__NERSet