-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.py
More file actions
33 lines (26 loc) · 1.2 KB
/
Copy pathclass.py
File metadata and controls
33 lines (26 loc) · 1.2 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
import re
class InitialData():
def normalizeBreak(self, text):
windowBreakline = re.compile('\r\n')
return windowBreakline.sub( '\n', text)
def getbreakArray(self, text):
breakline = re.compile('\n')
multiSpace = re.compile(' +')
return [ multiSpace.sub( ' ', each.strip()) for each in text.split('\n')]
def getUseData(self, text):
breakline = re.compile('\n')
multiSpace = re.compile(' +')
dotSpace = re.compile('\. ')
return dotSpace.sub( '.', multiSpace.sub( ' ', breakline.sub( '. ', text ) ))
def __init__(self, text):
self.normal = self.normalizeBreak(text)
self.breakArray = self.getbreakArray(self.normal)
self.data = self.getUseData(self.normal)
texture = """right breast cancer s/p simple mastectomy, sentinel LN biopsy and implantation of a tissue expander on 2016/08/11, s/p second stage breast reconstruction surgery on 2016-12-08
a 225ml saline-filled prosthesis was implanted and filled up to 230ml
mild contracture
recommend compression of the prosthesis in prone position
more power on mannual massage
RTC for evaluation of effect of prosthesis massage"""
data = InitialData(texture)
print('aaa')