You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# return jsonify(results={"success": False,"msg": "please send type: movie or flight"})
71
+
#msg = "Hi Customer, Booking ID: AGSN0004863077. Seats: DIAMOND-B10,B11,B12,B13 for Interstellar on Sat, 22 Nov, 2014 10:30pm at AGS Cinemas OMR: Navlur (SCREEN 4). Please carry your CC/DC card which was used for booking tickets"
Copy file name to clipboardExpand all lines: server/parser.py
+27-6
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ def getFlightId(msg):
14
14
fid=m.group(2)
15
15
response["fid"] =fid
16
16
returnresponse
17
-
17
+
18
18
defgetLocation(msg):
19
19
response= {}
20
20
m=re.search(LOCATION_PATTERN, msg, re.IGNORECASE)
@@ -108,15 +108,36 @@ def test(msg):
108
108
# a = dparser.parse("on Fri, 09 Jan from MAA to AMD at 2015",fuzzy=True)
109
109
# print a.year
110
110
111
+
defparse(msg):
112
+
print"inside parse"
113
+
printmsg
114
+
details= {}
115
+
# if i == "movie":
116
+
# details = parseMovies(msg)
117
+
# elif i == "flight":
118
+
# details = parseFlight(msg)
119
+
# else:
120
+
# print "parse type not defined"
121
+
checkmsg=msg.lower()
122
+
if"movie"incheckmsgor"seats"incheckmsg:
123
+
details=parseMovies(msg)
124
+
elif"flight"incheckmsgor"flt"incheckmsg:
125
+
details=parseFlight(msg)
126
+
else:
127
+
print"parse type not defined"
128
+
printdetails
129
+
print"------"
130
+
returndetails
131
+
132
+
111
133
if__name__=='__main__':
112
134
msg1="Dear Guest, Your PNR: 00WJSS for Flight: LB632 MAA-AMD Date: 09/01/2015 Dep.Time: 05:20hrs. Contact 1800-4250-0666 for assistance. Happy Flying! air costa"
113
135
msg2="The PNR for your Spicejet Flt SG281 for Ahmedabad-Chennai on 28 Oct 14 at 05:50 hrs is LEHW8B. Thank you."
114
136
msg3="Dear Guest, Your PNR is 00WJSS for flight LB632 on Fri, 09 Jan from MAA to AMD at 0520 and 00WJSS for flight SG281 on Tue, 20 Jan from AMD to MAA at 0555"
115
137
movie="Hi Customer, Booking ID: AGSN0004863077. Seats: DIAMOND-B10,B11,B12,B13 for Interstellar on Sat, 22 Nov, 2014 10:30pm at AGS Cinemas OMR: Navlur (SCREEN 4). Please carry your CC/DC card which was used for booking tickets"
116
138
movie2="Booking ID: WWT782B | Movie: HERCULES (U/A) | Show Details: 9-Aug | 06:45 PM | Screen: SCREEN-9 | Class: ELITE | Seats: C13, C14 | Multiplex: LUXE | Location: PHOENIX MARKET CITY, VELACHERY, CHENNAI | No ticket required. Please show this SMS to a cinema attendant for entry into the screen. Thank you"
0 commit comments