mishtert commited on
Commit
80452b7
1 Parent(s): 1be55d5

Upload headlinewrap.py

Browse files
Files changed (1) hide show
  1. headlinewrap.py +71 -0
headlinewrap.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from utils.summarize_utils.summ_utils import get_osid, map_terms
2
+ from utils.summarize_utils.headline_utils import get_condition
3
+
4
+ def get_headline(status,phase,osid, sid,condition):
5
+ if status =='Recruiting':
6
+ headline = "Initiation of " + \
7
+ '/'.join(phase.lower().split('|')) + ' '+ \
8
+ "trial " + \
9
+ get_osid(osid,sid)+ \
10
+ "for " + \
11
+ get_condition(condition) + \
12
+ " reported"
13
+ return map_terms(headline)
14
+ elif status == 'Active, not recruiting':
15
+ headline = "Planned " + \
16
+ '/'.join(phase.lower().split('|')) + ' '+ \
17
+ "trial " + \
18
+ get_osid(osid,sid)+ \
19
+ "for " + \
20
+ get_condition(condition) + \
21
+ " reported"
22
+ return map_terms(headline)
23
+
24
+ elif status =='Completed':
25
+ headline = "Completion of " + \
26
+ '/'.join(phase.lower().split('|')) + ' '+ \
27
+ "trial " + \
28
+ get_osid(osid,sid)+ \
29
+ "for " + \
30
+ get_condition(condition) + \
31
+ " reported"
32
+ return map_terms(headline)
33
+
34
+ elif status =='Terminated':
35
+ headline = "Termination of " + \
36
+ '/'.join(phase.lower().split('|')) + ' '+ \
37
+ "trial " + \
38
+ get_osid(osid,sid)+ \
39
+ "for " + \
40
+ get_condition(condition) + \
41
+ " reported"
42
+ return map_terms(headline)
43
+
44
+ elif status =='Withdrawn':
45
+ headline = "Withdrawal of " + \
46
+ '/'.join(phase.lower().split('|')) + ' '+ \
47
+ "trial " +\
48
+ get_osid(osid,sid)+ \
49
+ "for " + \
50
+ get_condition(condition) + \
51
+ " reported"
52
+ return map_terms(headline)
53
+
54
+ elif status =='Suspension':
55
+ headline = "Suspension of " + \
56
+ '/'.join(phase.lower().split('|')) + ' '+ \
57
+ "trial " +\
58
+ get_osid(osid,sid)+ \
59
+ "for " + \
60
+ get_condition(condition) + \
61
+ " reported"
62
+ return headline
63
+ else:
64
+ headline = "Ongoing " + \
65
+ '/'.join(phase.lower().split('|')) + ' '+ \
66
+ "trial " +\
67
+ get_osid(osid,sid)+ \
68
+ "for " + \
69
+ get_condition(condition) + \
70
+ " reported"
71
+ return map_terms(headline)