-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmails.py
35 lines (30 loc) · 1.13 KB
/
Emails.py
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
class Email:
def __init__(self,body,header,id):
self.body = body
self.header = header
self.stime = None
self.etime = None
self.speaker = None
self.location = None
self.topic = None
self.newHeader = header
self.newBody = body
self.sentences = []
self.paragraphs = []
self.fileID = id
def replace(self,label,data):
data = str(data)
newStartTag = "<" + label + ">"
newEndTag = "</" + label + ">"
newWholeTag = newStartTag + data + newEndTag
self.newHeader = self.newHeader.replace(data,newWholeTag)
self.newBody = self.newBody.replace(data,newWholeTag)
def combineTogether(self):
for i in self.paragraphs:
self.newBody = self.newBody.replace(i, "<paragraph>" + i + "</paragraph>")
for i in self.sentences:
self.newBody = self.newBody.replace(i, "<sentence>" + i + "</sentence>")
self.replace("stime",self.stime)
self.replace("etime", self.etime)
self.replace("speaker", self.speaker)
self.replace("location", self.location)