te_rex 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eba4b0e904897695a6ffe59f676cd41129d9f9d3
4
- data.tar.gz: b9714ec30ca138fed335894c95503c113c8e605d
3
+ metadata.gz: 8816e6f5c24b53958172e5dc2da23ad5b4f14926
4
+ data.tar.gz: 87ad79c27a094ee3950dfcdb2f45ba4a8d52e1e7
5
5
  SHA512:
6
- metadata.gz: 2f0e6f419f099c3f485c1b829d1e5421935092af35fc2184fdd9a70de0f7127cbf95bcfc100e6e8f0d0efc7eeda15f4b8cc5f696211c852a92933220ae2894ff
7
- data.tar.gz: 3f017ed552f0fdcb0ba89a0ffcc188f76c13780571b67ca4edd254980605ff5166af536610da2d3b2570b8bb5c39a3b1e0dc57d1873c1de89b370447b2426859
6
+ metadata.gz: 1386beae5b7e4f25c0de163d9192e986d10cb9be74809ddc978019c9087c6fcaa3bd76c6360bd491c6d68c7c233cb4203ba8452822a96eac5c905e637e7b974a
7
+ data.tar.gz: 0f1038baf01be0523a0b3541c35be8d5b673fe7c3ded9575dc1d68284502d996eab4554f9a582f345e43b825ce50a06dd3411f486e02ddb4bc30deafe7f63f34
@@ -12,7 +12,7 @@ module TeRex
12
12
 
13
13
  # Remove cardinal terms (1st, 23rd, 42nd)
14
14
  def remove_cardinal(s)
15
- s.gsub(/\d+\w{2}/, '')
15
+ s.gsub(/[0-9]{2}[a-z,A-Z]{2}/, '')
16
16
  end
17
17
 
18
18
  # Replace date times with TERM (09MAR04, 02-23-14, 2014/03/05)
data/lib/te_rex/corpus.rb CHANGED
@@ -49,7 +49,6 @@ module TeRex
49
49
  @set ||= Dir[@glob].map do |file|
50
50
  @format_klass.new(file, @category_klass)
51
51
  end
52
- @set
53
52
  end
54
53
 
55
54
  def partition_training_by_file
@@ -11,18 +11,24 @@ module TeRex
11
11
  "be",
12
12
  "by",
13
13
  "do",
14
+ "error",
14
15
  "for",
16
+ "hotel",
15
17
  "in",
16
18
  "into",
17
19
  "it",
18
20
  "it's",
19
21
  "its",
20
22
  "of",
23
+ #"process",
24
+ "reservation",
21
25
  "so",
26
+ "sorry",
22
27
  "than",
23
28
  "that",
24
29
  "that's",
25
30
  "the",
31
+ "unable",
26
32
  "what",
27
33
  "what's",
28
34
  "where",
@@ -1,3 +1,3 @@
1
1
  module TeRex
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require_relative "../lib/te_rex"
2
- class AlphaNumTest < MicroTest::Test
2
+ class AlphaNumTest < PryTest::Test
3
3
 
4
4
  test "generates array of lowercase roman characters" do
5
5
  res = TeRex::AlphaNum.gen
@@ -1,5 +1,5 @@
1
1
  require_relative "../lib/te_rex"
2
- class BayesDataTest < MicroTest::Test
2
+ class BayesDataTest < PryTest::Test
3
3
 
4
4
  test "punctuation is removed (except %)" do
5
5
  s1 = "This * punctuation se%ntence ).!"
@@ -54,9 +54,25 @@ class BayesDataTest < MicroTest::Test
54
54
 
55
55
  assert s11 == "moneyterm will be paid on datetime with moneyterm"
56
56
  assert s22 == "I get moneyterm on datetime and on datetime with %49 and %"
57
- assert s33 == "And I have cdes in his one wi%th % refund too"
57
+ assert s33 == "And I have cdes in his one wi%th 100% refund too"
58
58
  end
59
59
 
60
+ test "check that error codes are not stripped out" do
61
+ h108 = "H108 PROCESS_FAIL 50008 Unable to cancel reservation. An unknown error has occurred. Please call us for more information."
62
+ h109 = "H109 PROCESS_FAIL 50008 Unable to cancel reservation. An unknown error has occurred. Please call us for more information."
63
+ h110 = "H110 PROCESS_FAIL 50008 Unable to cancel reservation. An unknown error has occurred. Please call us for more information."
64
+ h115 = "H115 UNABLE_TO_PROCESS_REQUEST 50010 Unable to obtain cancellation number. Please contact customer service."
65
+
66
+ s1 = TeRex::Classifier::BayesData.clean(h108)
67
+ s2 = TeRex::Classifier::BayesData.clean(h109)
68
+ s3 = TeRex::Classifier::BayesData.clean(h110)
69
+ s4 = TeRex::Classifier::BayesData.clean(h115)
70
+
71
+ assert s1 == "H108 PROCESSFAIL 50008 Unable to cancel reservation An unknown error has occurred Please call us for more information"
72
+ assert s2 == "H109 PROCESSFAIL 50008 Unable to cancel reservation An unknown error has occurred Please call us for more information"
73
+ assert s3 == "H110 PROCESSFAIL 50008 Unable to cancel reservation An unknown error has occurred Please call us for more information"
74
+ assert s4 == "H115 UNABLETOPROCESSREQUEST 50010 Unable to obtain cancellation number Please contact customer service"
75
+ end
60
76
  test "index frequency has correct counts" do
61
77
  s = 'Here is a sentence $141.34 that that $60 that 123.56 I need & & ^ % $c#@ to check the index is correct and okay.'
62
78
  result = TeRex::Classifier::BayesData.index_frequency(s)
@@ -64,7 +80,5 @@ class BayesDataTest < MicroTest::Test
64
80
  assert result[:moneyterm] == 3
65
81
  assert result[:sentenc] == 1
66
82
  assert result[:sentence] == 1
67
-
68
83
  end
69
-
70
84
  end
data/test/corpus_test.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #require_relative "../lib/te_rex"
2
- class CorpusTest < MicroTest::Test
2
+ class CorpusTest < PryTest::Test
3
3
  class MockErrorClassifier
4
4
  end
5
5
 
@@ -1,5 +1,5 @@
1
1
  require_relative "../lib/te_rex"
2
- class SparseBayesTest < MicroTest::Test
2
+ class SparseBayesTest < PryTest::Test
3
3
  @@refund = [
4
4
  "Free cancellation before 1201 AM on 9/17/14! If you cancel or change your reservation after 1201 AM on 9/17/14 the hotel will charge you for the total cost of your reservation.",
5
5
  "ALL RESERVATIONS MUST BE CANCELLED 24 HOURS PRIOR TO HOST TIME UNLESS DEPOSIT REQUIRED IF THIS RESERVATION HAS BEEN MADE ELECTRONICALLY PLEASE CANCEL IT ELECTRONICALLY TO AVOID CONFUSION AND A NO SHOW BILL. POLICY SUBJECT TO CHANGE. .",
@@ -0,0 +1,94 @@
1
+ module TeRex
2
+ module Train
3
+ AVAIL = [
4
+ "A language code is needed for language translation.",
5
+ "Cached availability could not be found. Please reissue availability.",
6
+ "A maximum of 6 people are allowed to stay in the same room.",
7
+ "A page ID is needed for language translation.",
8
+ "A valid language code is needed for a translation request.",
9
+ "Activity purchase required.",
10
+ "All inventories were unsuccessful.",
11
+ "Cannot book over 500 days in advance",
12
+ "City could not be determined. LocationCode or (City and Country) are valid combinations",
13
+ "DATA_VALIDATION",
14
+ "Data in this request could not be validated: Multiple locations have been identified please refine your search criteria",
15
+ "Hotel ID not recognized.",
16
+ "DIRECT CONNECT ERROR *I 0RCF OR ET NotProcessed BusinessLogic ERR.SWS.HOST.ERROR_IN_RESPONSE",
17
+ "Hotel has no overview information available.",
18
+ "Hotel not found.",
19
+ "Problem getting detailed room avail for XML/WS. Rate Detail threw an exception. Query ID was and PropID:",
20
+ "Incorrect XML format. Please check for missing elements or odd characters.",
21
+ "Incorrect format for bed type preference.",
22
+ "com. travelnow. supplier. hotel. merchant. translator. Translator Exception: Rate Detail Service threw an exception. Query ID was and PropID:",
23
+ "Incorrect value for star rating.",
24
+ "Invalid or expired code.",
25
+ "Inventory Source Information Mismatch",
26
+ "Hotel room type not found at this hotel. Please select a different room, dates or or hotel.: Common Errors::MSTError: 180 <TNOWERROR_ATTR> <SUPPLIER_ERROR_CODE> Common Errors:: MSTError:180 </SUPPLIER_ERROR_CODE> </TNOWERROR_ATTR>",
27
+ "Minimum number of nights required.",
28
+ "Must supply children age.",
29
+ "NO_RESULTS_FOUND",
30
+ "No vacancy. Please try different dates or nearby hotels.",
31
+ "Property ID is No Longer Available",
32
+ "Property ID lookup failed for supplier ID HotelID Query can not proceed",
33
+ "Not found in database.",
34
+ "PRICE_MISMATCH",
35
+ "Please enter a city and/or state name for this search.",
36
+ "Please enter a valid country code.",
37
+ "Please enter a valid hotel ID.",
38
+ "Please enter a valid state code.",
39
+ "Please narrow down your search by entering additional criteria.",
40
+ "Please narrow down your search by entering destination information for latitude and longitude searches.",
41
+ "Please narrow this search by specifying more parameters.",
42
+ "Please narrow your search by entering a city name.",
43
+ "Please provide a check-in date or confirmation number for this search.",
44
+ "Please provide a latitude decimal coordinate for this search.",
45
+ "Please provide a longitude decimal coordinate for this search.",
46
+ "Please provide decimal latitude and longitude coordinates for this search.",
47
+ "Please provide one or more valid amenity codes for this search.",
48
+ "Please try different dates or nearby hotels.",
49
+ "Pricing error - we could not retrieve the rate information you requested at this time.",
50
+ "Refer to the Multiple Locations FAQ for details on recovering from these types of errors.",
51
+ "Specified arrival date is prior to today's date.",
52
+ "Specified city could not be resolved as valid location",
53
+ "Supplier Return Text is Null and Unparsable.",
54
+ "Supplier id not recognized.",
55
+ "The Guests tag is too large or too small based on what was specified in the Number Of Rooms tag.",
56
+ "The Hotel Identifier is used along with any other identifier (locationID marketKeyword or Address).",
57
+ "The amenity code is invalid.",
58
+ "The chain code is invalid.",
59
+ "The client request lacked location info in hotel shopping request.",
60
+ "The client requests have bad end or depart/arrive dates.",
61
+ "The client requests have bad start or begin or depart/arrive dates.",
62
+ "The hotel you selected is no longer available. Please choose another. ",
63
+ "The locale is not valid.",
64
+ "The location cannot be solved by the market location service with the client request’s location info.",
65
+ "The number of hotel guests exceeds the allowable number per hotel room.",
66
+ "The number of rooms in the request is greater than 1.",
67
+ "The rating code is invalid.",
68
+ "The room type or rate you selected is no longer available. Please choose another. error.atlantis.priceMismatch",
69
+ "The session has expired",
70
+ "There are No Hotel solutions found for criteria specified.",
71
+ "There is an error in your XML request. The structure is not correct the XML is not well formed and/or tags are not correctly created.",
72
+ "There must be at least one adult for every room or suite you reserve.",
73
+ "This order-by-type query is not valid. Please try again.",
74
+ "This product is currently not available. Requested product is not available.",
75
+ "This request can not be processed because the specified arrival date is prior to today's date. Correct this information and try again",
76
+ "500 days advance is the maximum that can be searched.",
77
+ "Choose another hotel and try again",
78
+ "This request can not be processed. Try again",
79
+ "This reservation can not be processed because it has more than 30 days. Correct this information and try again",
80
+ "This sort-by-type query is not valid. Please try again.",
81
+ "UNAUTHORIZED_REQUESTS DATA_VALIDATION 90047 The client made a request for which it does not have authorization.",
82
+ "We cannot accept a reservation for longer than 30 days",
83
+ "When client request does not include POS info.",
84
+ "XML is not well formed ",
85
+ "You can book only 1 or 2 rooms at a time.",
86
+ "You have exceeded the maximum (100) number of hotels for your request.",
87
+ "com.travelnow. supplier. hotel. merchant. translator. Translator Exception: RateDetail Service threw an exception.",
88
+ "errors.supplier.hotel.nolonger error from supplier",
89
+ "mystiqueratebreakdown",
90
+ "mystiqueratevalidation",
91
+ "time_start OR time_end is not a valid date ('Y-m-d H:i:s' or 'Y-m-d')"
92
+ ]
93
+ end
94
+ end
@@ -0,0 +1,90 @@
1
+ module TeRex
2
+ module Train
3
+ BOOK = [
4
+ "AGENT_ATTENTION Reservation Requires Agent to Confirm Agent waiting on supplier for confirmation number",
5
+ "ALREADY_BOOKED",
6
+ "Agent waiting on supplier for confirmation number",
7
+ "Alternate phone must be numeric and include area code",
8
+ "Data in this request could not be validated: A valid first and last name of one adult guest must be specified for each room",
9
+ "Data in this request could not be validated: Last name contains invalid (or insufficient) data",
10
+ "Data in this request could not be validated: The specified email address cannot be resolved please try again.",
11
+ "Data in this request could not be validated: first name contains invalid (or insufficient) data.",
12
+ "Additional Agent Attention Is Required For This Reservation",
13
+ "Date format does not exist",
14
+ "Duplicate reservation request.",
15
+ "Failure Validate Booking:",
16
+ "Final Reservation Price Check failed before booking QuoteKey",
17
+ "Final Reservation Price Check failed before booking. (Rate Requested: 133.3(USD)) (New Rate: 143.4(USD)). Please try again with new rate.",
18
+ "Home phone must be numeric and include area code",
19
+ "Hotel Booking Error Booked rate exceeds quoted rate Booking error Property Error Booking error",
20
+ "Hotel Booking Error Booking error",
21
+ "Error unmarshaling the request using Fast Info Set.: com. expedia. e3.es.legacy booking. service.Legacy Booking Exceptions:2<TNOWERROR_ATTR> <SUPPLIER _ERROR_ CODE> com. expedia. e3.es.legacy booking. service. Legacy Booking Exceptions:2 </SUPPLIER _ERROR_ CODE> </TNOWERROR_ATTR>",
22
+ "Timeout exception occurred and RollbackOnTimeout = true. Order will be rolled back: 6994 The booking attempt timed out. Attempt the booking again if you receive this error.",
23
+ "Hotel Booking Error Rate not available",
24
+ "Hotel Booking Error double book",
25
+ "Hotel Booking Error try again",
26
+ "Hotel.Book: Invalid initials. Must be 2 alpha numeric characters and may not contain any special characters",
27
+ "HotelRoom_1 unavailable HotelId= : RateCode= : RoomCode= : RateAccessCode= : HostCode= : GuestCount= ",
28
+ "ITINERARY_ALREADY_BOOKED",
29
+ "Information required for processing this request could not be created. The requested itinerary has not been created",
30
+ "Invalid country_code.",
31
+ "Invalid number of arguments.",
32
+ "Invalid room guest count. Please provide guest name for each room.",
33
+ "Last Name must be at least two characters in room #1 INVALID_LAST_NAME",
34
+ "Missing confirmation number.",
35
+ "Missing inventory source code",
36
+ "Missing room type or rate plan code",
37
+ "Multiple booking in progress. Please retry",
38
+ "No availabilty found for reservation request. Please try again with correct roomTypeCode and native room rate. queryId= reqRatePlanId= reqRoomTypeId= supplierRatePlanId= supplierRoomTypeId= supplierRatePlanStatus= No Availabilty found for Reservation Request. Please try again with correct roomTypeCode and native room rate.",
39
+ "Only one room at a time may be reserved.",
40
+ "Please resubmit the booking request",
41
+ "Postal code contains invalid (or insufficient) data",
42
+ "Price Change happened for the given product from 1010.54 to USD2021.08 PRICE_CHANGED com.orbitz.tbs.model.PriceChangeException: Sell rate in the request ( 1010.54 ) is less than reprice sell rate (USD2021.08). Change in rate can not process request\\n\\tat com.orbitz.tbs.hotel.txn.HotelReservationServiceImpl.doPriceChangeCheck(HotelReservationServiceImpl.java:543)\\n\\tat com.orbitz.tbs.hotel.txn.HotelReservationServiceImpl.buildBookCriteria(HotelReservationServiceImpl.java:386",
43
+ "Price has changed.",
44
+ "Property not available at booking time",
45
+ "Rate not available.",
46
+ "Reservation Request is duplicated. Please correct the informations or contact us",
47
+ "Reservation Requires Agent to Confirm",
48
+ "Reservation is locked.",
49
+ "Room code invalid",
50
+ "SOLD_OUT The room you were trying to book has sold out. Please choose another. errors.supplier.soldout: Hotel room type not found at this hotel. Please select a different room dates or or hotel",
51
+ "Sorry. Availability not found for Reservation Request. Verify another choice from the available selections to complete the purchase",
52
+ "Supplier Not Ready",
53
+ "The Corporate ID Number supplied is invalid. Please correct or delete the information from the field.",
54
+ "The Corporate ID you entered contained illegal characters. Please correct.",
55
+ "The Frequent Guest ID you entered contained illegal characters. Please correct.",
56
+ "The Frequent Guest Number supplied is invalid. Please correct or delete the information from the field.",
57
+ "The booking is not yet confirmed. Refer to Pending Process",
58
+ "The hotel was unable to provide an itinerary number for the reservation. Please try to make your reservation again at a later time.",
59
+ "The maximum number of persons per room has been exceeded. The room capacity is beyond the maximum number allowed.",
60
+ "The multi-room booking must have a different/unique guest name on each room. Please correct this informations and post again the Reservation",
61
+ "The number of rooms requested is greater than the maximum number of rooms allowed per booking.",
62
+ "The requested number of nights is less than the minimum number of nights required for stay.",
63
+ "The room rate was changed.",
64
+ "The room type or rate you selected is no longer available. Please choose another.",
65
+ "The selected room is sold out",
66
+ "There was a problem with this booking communicating with the backend supplier. This booking will be resolved automatically within 5 minutes. Please DO NOT process a duplicate booking until an itinerary check is made to confirm the status of this booking attempt.",
67
+ "There was a problem with your hotel room reservation. Please select another date or a different hotel and try again",
68
+ "This product is currently not available. com.orbitz.tbs.model.ProductUnavailableException: Both Promoted and Unpromoted SellRates from the reprice should not be null\\n\\tat com.orbitz.tbs.hotel.txn.HotelReservationServiceImpl.validateHotelSelectInfo(HotelReservationServiceImpl.java:503)\\n\\tat com.orbitz.tbs.hotel.txn.HotelReservationServiceImpl.loadBookCriteria(HotelReservationServiceImpl.java:197)\\n\\tat com.orbitz.tbs.hotel.txn.HotelReservationServiceValidatingDecorator.loadBookCriteria(HotelReservationServiceValidatingDecorator.java:37",
69
+ "This product is currently not available. com.orbitz.tbs.model.ProductUnavailableException: Occupancy Validation Error : Cannot find availability for requested rooms\\n\\tat com.orbitz.tbs.hotel.shop.select.PostSelectionProcessor.createStatelessHotelSelectInfo(PostSelectionProcessor.java:268)\\n\\tat com.orbitz.tbs.hotel.shop.select.workflow.StatelessHotelRepriceWorkflow.execute(StatelessHotelRepriceWorkflow.java:77)\\n\\tat com.orbitz.tbs.hotel.shop.select.StatelessRepricer$1.doInMonitor(StatelessRepricer.java:39",
70
+ "This product is currently not available. com.orbitz.tbs.model.SystemException: Caught an exception during lapsang lookupHotelsByMasterID\\n\\tat com.orbitz.tbs.hotel.mgr.HotelSearchMgr.lookupHotelsByMasterID(HotelSearchMgr.java:304)\\n\\tat com.orbitz.tbs.hotel.mgr.HotelSearchMgr.searchByMasterId(HotelSearchMgr.java:186)\\n\\tat com.orbitz.tbs.hotel.mgr.HotelSearchMgr.search(HotelSearchMgr.java:172)\\n\\tat com.orbitz.tbs.hotel.shop.svc.HotelFetchServiceImpl.fetchHotels(HotelFetchServiceImpl.java:106",
71
+ "This product is currently not available. com.orbitz.tbs.model.SystemException: Hotel booking failed due to a hotel booking error. HotelBookException: com.orbitz.hotel.model.service.HotelBookException: Hotel lapsang book service exception: Failed Lapsang Service Invocation. requestURL: http:\\/\\/teakettle.qa1.o.com\\/hotel\\/book\\nstatusCode: 404\\nstatusMessage: Object Not Found\\nserver: TeaKettle-4.11.1\\n\\tat com.orbitz.tbs.hotel.book.handler.HotelBookProductErrorHandler.handleSystemException(HotelBookProductErrorHandler.java:264)\\n\\tat com.orbitz.tbs.hotel.book.handler.HotelBookProductErrorHandler.handleBaseException(HotelBookProductErrorHandler.java:174)\\n\\tat com.orbitz.tbs.hotel.book.handler.HotelBookProductErrorHandler.handleHotelBookExceptions(HotelBookProductErrorHandler.java:126)\\n\\tat com.orbitz.tbs.hotel.book.svc.HotelSpiReservationServiceImpl.bookProduct(HotelSpiReservationServiceImpl.java:358)\\n\\tat com.orbitz.tbs.hotel.book.svc.HotelSpiReservationServiceImpl.bookProduct(HotelSpiReservationServiceImpl.java:136",
72
+ "This reservation can not be completed. Please correct the customer informations and try again",
73
+ "This reservation can not be completed. Please correct the e-mail address",
74
+ "This reservation can not be processed because it has more than 30 days. Correct this information and try again",
75
+ "This reservation can not be processed because the first name contains invalid data. Please correct this reservation and try again",
76
+ "TravelNow.com cannot service this request. The specified email address cannot be resolved",
77
+ "TravelNow.com was unable to appropriately create back-end information required for this request.",
78
+ "Try process your reservation again or contact us",
79
+ "Unable to Add Traveler",
80
+ "Your confirmation number is currently not available. We will email the confirmation number when it becomes available.",
81
+ "error. bookHold Error: Expedia Book Hold Req Failed",
82
+ "error. unknown: Create Order Unexpected Exception: java. util. MissingResource Exception: Couldn't find 3-letter country code for UK java.util. Missing Resource Exception: Couldn't find 3-letter country code for UK at java. util. Locale. getISO3 Country",
83
+ "error.bookingRuleChanged: Hotel rules changed at time of booking.",
84
+ "error.coupon error.currencyHasChanged error.customer FileError error.customer FileError: Customer Add Failed error.duplicateMessageGUID",
85
+ "error.priceMismatch: Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Hotel price changed during booking",
86
+ "error.unknown: Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Failed to do a currency conversion.: CommonErrors::MSTError:205 <TNOWERROR_ATTR&gt;<SUPPLIER_ERROR_CODE> CommonErrors::MSTError:205</SUPPLIER_ERROR_CODE></TNOWERROR_ATTR>",
87
+ "mystiquebooking"
88
+ ]
89
+ end
90
+ end
@@ -0,0 +1,51 @@
1
+ module TeRex
2
+ module Train
3
+ CANCELFORBIDDEN = [
4
+ "CANCEL DATE PASSED",
5
+ "CANCELLATION DEADLINE PASSED",
6
+ "CANCELLATION_DEADLINE_PASSED",
7
+ "CANCEL_DATE_PASSED",
8
+ "Hotel pre-cancel failed",
9
+ "RES CANCELLED",
10
+ "RES_CANCELLED",
11
+ "Reservation cannot be cancelled online",
12
+ "Reservation cannot be cancelled",
13
+ "Reservation not cancelable or zero refund",
14
+ "Too late to cancel reservation - deadline date has passed.",
15
+ "Too late to cancel reservation -",
16
+ "Too late to cancel reservation",
17
+ "Unable to cancel reservation. Please contact customer service.",
18
+ "Unable to cancel reservation. This reservation is pending. Please contact customer service.",
19
+ "Unable to cancel reservation. This reservation was manually booked. Please contact customer service.",
20
+ "Unable to cancel reservation.",
21
+ "Unable to obtain cancellation number. Please contact customer service.",
22
+ "booking cannot be cancelled online.",
23
+ "booking cannot be cancelled.",
24
+ "can not cancel",
25
+ "cancellable",
26
+ "cannot be cancelled.",
27
+ "com.orbitz.tbs.model.txn.PolicyViolationException",
28
+ "com.orbitz.ws.hotel.cancel.service.HotelCancelServiceImpl.buildHotelCancelResponse(HotelCancelServiceImpl.java:204)com.orbitz.ws.hotel.cancel.service.HotelCancelServiceImpl.execute(HotelCancelServiceImpl.java:160",
29
+ "com.orbitz.ws.hotel.cancel.service.HotelCancelServiceImpl.buildMultiRoomCancelResponse(HotelCancelServiceImpl.java:288)",
30
+ "com.orbitz.ws.tbs.ReservationServiceSupport.buildPreCancelFutureTaskResponse(ReservationServiceSupport.java:433)",
31
+ "com.orbitz.ws.tbs.ReservationServiceSupport.callFutureTask(ReservationServiceSupport.java:313",
32
+ "deadline date has passed",
33
+ "error.ResModifyError: Changes are not allowed",
34
+ "error.blockSpace",
35
+ "error.cancel.orderline.",
36
+ "error.nonRefundableBooking: Reservation is Non-Refundable.",
37
+ "error.orderline.already.canceled",
38
+ "multiple.notSupported",
39
+ "mystiquecancellation",
40
+ "no refund",
41
+ "not cancelable",
42
+ "not cancellable",
43
+ "productPreCancelInfos cannot be null or empty",
44
+ "reference your Itinerary Number if you have questions regarding the status of your reservation.",
45
+ "uncancelable",
46
+ "uncancellable",
47
+ "zero refund"
48
+ ]
49
+ end
50
+ end
51
+
@@ -0,0 +1,54 @@
1
+ module TeRex
2
+ module Train
3
+ CANCEL = [
4
+ "I AND CANCEL UC HOTEL SEGMENT 01",
5
+ "A record was missing in this process",
6
+ "CANCELLED PRODUCT",
7
+ "CANCELLED_PRODUCT",
8
+ "Client not found in system.",
9
+ "Hotel preCancel failed",
10
+ "Unable to cancel reservation. An unknown error has occurred. Please call us for more information.",
11
+ "MULTI ROOM PARTIAL CANCELLATION",
12
+ "MULTI_ROOM_PARTIAL_CANCELLATION",
13
+ "No Hotel Confirmation Number Found",
14
+ "No HotelConfirmation Number Found",
15
+ "Order is currently being processed",
16
+ "PARTIAL CANCELLATION",
17
+ "PRODUCT_UNAVAILABLE",
18
+ "Please contact customer service.",
19
+ "Please enter the customer's reservation confirmation number.",
20
+ "Please try again later.",
21
+ "Probably your reservation has already processed and cancelled. Please call us for more information.",
22
+ "RES_NOT_FOUND",
23
+ "Requested for product which is already cancelled.",
24
+ "Reservation Not Cancelled.",
25
+ "Reservation could not be found",
26
+ "Reservation could not be retrieved.",
27
+ "Reservation not found in system.",
28
+ "The hotel confirmation information provided could not be resolved to a valid record",
29
+ "The room(s) in this hotel reservation are not cancelled",
30
+ "This product is currently not available",
31
+ "This request has already processed and cancelled.",
32
+ "This reservation could not be found.",
33
+ "Unable to cancel reservation",
34
+ "cannot find booking",
35
+ "cannot find reservation",
36
+ "com.orbitz.tbs.model.SystemException: Hotel preCancel failed",
37
+ "com.orbitz.tbs.spi.txn.cancel.SpiProductPreCancelCriteria productType=Hotel",
38
+ "error.order.currentProcessing.tryLater",
39
+ "error.orderLine.notFound.",
40
+ "error.orderNumber.notFound",
41
+ "for.ordernum.orderguid.passed",
42
+ "multiCurrencyDetails=\\n\\tat com.orbitz.tbs.hotel.mgr.HotelCancelServiceManager.handleHotelCancelException(HotelCancelServiceManager.java:634)\\n\\tat com.orbitz.tbs.hotel.mgr.HotelCancelServiceManager.preCancelMerchantBooking(HotelCancelServiceManager.java:322)\\n\\tat com.orbitz.tbs.hotel.mgr.HotelCancelServiceManager.preCancel(HotelCancelServiceManager.java:271)\\n\\tat com.orbitz.tbs.hotel.book.svc.HotelSpiReservationServiceImpl.preCancelProduct(HotelSpiReservationServiceImpl.java:913",
43
+ "mystiquecancellation",
44
+ "no booking found",
45
+ "not found",
46
+ "product already cancelled.",
47
+ "productLocatorCode=",
48
+ "reservation not found",
49
+ "reservationStartDate=",
50
+ "room not found",
51
+ "this reservation has not been canceled"
52
+ ]
53
+ end
54
+ end
@@ -0,0 +1,66 @@
1
+ module TeRex
2
+ module Train
3
+ CREDITDATA = [
4
+ "1\\u0087FORMAT ERROR ON OPTIONAL FIELD NotProcessed BusinessLogic ERR.SWS.HOST.ERROR_IN_RESPONSE",
5
+ "Address category (ex. Home Work etc) is required.",
6
+ "CC account name error.",
7
+ "CC name error.",
8
+ "CSV_FAIL",
9
+ "Credit card error.",
10
+ "Credit card type is invalid",
11
+ "Credit card type not accepted at the property",
12
+ "Do not honor. (Pickup message).",
13
+ "Hotel Booking Error (Card Failure - Processing Problem - Card Problem)",
14
+ "Invalid credit card data was provided. Please review and correct.",
15
+ "PAYMENT_FAILURE",
16
+ "Payment Failure happened",
17
+ "Phone category (ex. Home Work etc) is required.",
18
+ "Please provide a valid Credit card details INVALID_CREDIT_CARD Credit card details contains invalid values",
19
+ "Please provide a valid Credit card details INVALID_CREDIT_CARD com.orbitz.tbs.model.SystemException: Unknown exception caught stack is: com.orbitz.omp.api.model.OmpServiceException: Failed Lapsang Service Invocation. requestURL: http://teakettle.qa1.o.com/omp/payment/validate\\nstatusCode: 500",
20
+ "Please provide a valid Credit card details INVALID_CREDIT_CARD com.orbitz.tbs.model.SystemException: Unknown exception caught stack is: com.orbitz.omp.api.model.OmpServiceException: Failed Lapsang Service Invocation. requestURL: http:\\/\\/amexapp01q.qa.orbitz.net\\/omp\\/payment\\/validate\\nstatusCode: 500\\nstatusMessage: Internal Server Error\\nserver: Apache-Coyote\\/1.1 (caused by com.orbitz.lapsang.http.client.HttpInvocationResponseException: Failed Lapsang Service Invocation. requestURL: http:\\/\\/amexapp01q.qa.orbitz.net\\/omp\\/payment\\/validate\\nstatusCode: 500",
21
+ "Postal Code should be provided for specified country.",
22
+ "State or province required for specified country.",
23
+ "The Card Security Code you entered did not validate for your credit card please correct and resubmit. ",
24
+ "The card type provided is not accepted at this property or the credit card used is not listed in their record. Valid card types for the property are not known until booked when submitting a reservation. The user must select another card type that will be accepted by the property.",
25
+ "The credit card type is invalid. Please correct this information and try again",
26
+ "The specified credit card expiration date is invalid",
27
+ "The specified credit card expiration date is invalid. Please correct this information and try again",
28
+ "The specified credit card number is invalid. Please check the number you've provided and try again.",
29
+ "This request can not be processed. Please verify if the billing address is correct and try again",
30
+ "This reservation can not be processed. Verify if the number of credit card and expiration date are correct and try again",
31
+ "This reservation can not be processed. Verify if the number of credit card is correct and try again",
32
+ "We're sorry but we were unable to process your request. The card number that you entered may not be correct. Please verify that the card number is correct and try again. errors.resInfo.cc.invalidCardNumber: MSTERR_TRAVCC_INVALID_ACCOUNT: 505",
33
+ "We're sorry our system can not authenticate the information you have provided an information mismatch has occurred please verify your credit card and billing information are correct and try again.",
34
+ "We're sorry our system can not authenticate the information you have provided. An information mismatch has occurred. Please verify your credit card and billing information are correct and try again. errors.resInfo.cc: MSTERR_TRAVCC_DECLINE: 502",
35
+ "We're sorry our system can not authenticate the information you have provided. An information mismatch has occurred. Please verify your credit card and billing information are correct and try again.",
36
+ "We’re sorry but we were unable to process your request. Please verify that the billing address is correct and try again.",
37
+ "We’re sorry but we were unable to process your request. Please verify that the credit card number and expiration date are correct and try again.",
38
+ "We’re sorry but we were unable to process your request. The card number that you entered may not be correct. Please verify that the card number is correct and try again.",
39
+ "We’re sorry but we were unable to process your request. The expiration date that you entered may not be correct. Please verify that the expiration date is correct and try again. ",
40
+ "\\u0087INVALID CARD NUMBER\\u0087 NotProcessed BusinessLogic ERR.SWS.HOST.ERROR_IN_RESPONSE",
41
+ "\\u0087INVLD\\u0087 CREDIT CARD TYPE NOT ACCEPTED BY PROP NotProcessed BusinessLogic ERR.SWS.HOST.ERROR_IN_RESPONSE",
42
+ "\\u0087NR\\u0087 RMS NotProcessed BusinessLogic ERR.SWS.HOST.ERROR_IN_RESPONSE",
43
+ "at com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:182)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.validate(DefaultOmpProcessor.java:67)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.doValidate(BaseBookPaymentVerifyCommand.java:314",
44
+ "at com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:182)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.validate(DefaultOmpProcessor.java:67)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.execute(BaseBookPaymentVerifyCommand.java:215",
45
+ "com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:180)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.validate(DefaultOmpProcessor.java:66)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.doValidate(BaseBookPaymentVerifyCommand.java:296",
46
+ "com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Invalid Account Number",
47
+ "error.addressCategoryCode.value.invalid",
48
+ "error.creditCardDeclined <TNOWERROR_ATTR> <CC_TRANSACTIONSTATUS> </CC_TRANSACTIONSTATUS> <TRANSACTIONSTATUSMSG> Transaction refused </TRANSACTIONSTATUSMSG> </TNOWERROR_ATTR>",
49
+ "error.creditCardDeclined.invalidBillingAddress:Internal application error.:MessageReferenceId=UnknownMessageReferenceId.Exception=credit card transaction reenter(usually invalid address) by CC clearing house : CommonErrors::MSTError:501",
50
+ "error.creditCardDeclined.invalidExpirationDate: Internal application error.:MessageReferenceId=UnknownMessageReferenceId.Exception=Invalid/missing expiration date : CommonErrors::MSTError:507",
51
+ "error.creditCardDeclined.invalidOrMissingNumber: Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Invalid/missing credit card number : CommonErrors::MSTError:505",
52
+ "error.creditCardDeclined.invalidPaymentDetails: Internal application error.:MessageReferenceId=UnknownMessageReferenceId.Exception=Error in payment details - creditcard number not OK expiry date in the past etc. : CommonErrors::MSTError:545",
53
+ "error.creditCardDeclined:Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=The credit card number is not valid.:CommonErrors::MSTError:62",
54
+ "error.mismatch.last4digits.creditCard",
55
+ "error.phoneCategoryCode.value.invalid",
56
+ "error.postalCode.required.for.country",
57
+ "error.province.required.forCountry",
58
+ "errors.resInfo.cc.invalidCardNumber",
59
+ "errors.resInfo.cc.invalidExpirationDate",
60
+ "errors.resInfo.cc.invalidPaymentDetails",
61
+ "errors.supplier.csv: MSTERR_TRAVCC_CID_NOT_MATCHED: 529",
62
+ "mystiquebooking"
63
+ ]
64
+ end
65
+ end
66
+
@@ -0,0 +1,53 @@
1
+ module TeRex
2
+ module Train
3
+ CREDITDECLINE = [
4
+ "(remove the card from user)",
5
+ "CREDIT CARD DECLINE",
6
+ "Credit card transaction declined by CC clearing house",
7
+ "Credit card transaction declined by credit card clearing house",
8
+ "Exception=credit card transaction declined by CC clearing house : CommonErrors::MSTError:502",
9
+ "Exception=credit card transaction referral-call by CC clearing house : CommonErrors::MSTError:500",
10
+ "HOLDCARD(4)",
11
+ "error.creditCardDeclined: Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Invalid/missing subscriber name/merchant Id : CommonErrors::MSTError:504",
12
+ "error.creditCardDeclined: Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Unknown failure : CommonErrors::MSTError:527",
13
+ "error.creditCardDeclined: Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=XML cannot be parsed by payment provider.: CommonErrors::MSTError:540",
14
+ "error.creditCardDeclined: Internal application error.:MessageReferenceId=UnknownMessageReferenceId.Exception=Authorization network could not reach issuing bank. : CommonErrors::MSTError:553",
15
+ "error.creditCardDeclined:Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Internal error at payment provider - could be anything.: CommonErrors::MSTError:539",
16
+ "error.creditCardDeclined:Internal application error.:MessageReferenceId=UnknownMessageReferenceId. Exception=Invalid/missing amount: CommonErrors::MSTError:506",
17
+ "Internal application error.:MessageReferenceId=UnknownMessageReferenceId.Exception=Credit card error status - REFUSED (5). : CommonErrors::MSTError:874",
18
+ "MessageReferenceId=UnknownMessageReferenceId. Exception=Credit card error status",
19
+ "PAYMENT_FAILURE",
20
+ "Payment Failure happened",
21
+ "Payment Failure happened. PAYMENT_FAILURE com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Do Not Honor",
22
+ "Payment Failure happened. PAYMENT_FAILURE com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Expired Card",
23
+ "Payment Failure happened. PAYMENT_FAILURE com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Problem with account balance",
24
+ "Payment Failure happened. PAYMENT_FAILURE com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Referral - call local BA number",
25
+ "REFERRED (2)",
26
+ "This reservation can not be processed because your credit card was declined by CC clearing house.",
27
+ "We're sorry but we were unable to process your request. You may have temporarily exceeded your credit or debit card limit. Please choose a different card and try again. errors.resInfo.cc.exceededCardLimit: MSTERR_TRAVCC_CARDERROR_LIMITEXCEEDED: 886",
28
+ "We’re sorry but we were unable to process your request. You may have temporarily exceeded your credit or debit card limit. Please choose a different card and try again.",
29
+ "account balance",
30
+ "application error.:MessageReferenceId=UnknownMessageReferenceId",
31
+ "at com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:180)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.validate(DefaultOmpProcessor.java:66)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.doValidate(BaseBookPaymentVerifyCommand.java:296",
32
+ "at com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:182)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.debit(DefaultOmpProcessor.java:59)\\n\\tat com.orbitz.tbs.host.txn.command.book.BookPaymentCommand.doDebit(BookPaymentCommand.java:58)\\n\\tat com.orbitz.tbs.host.txn.command.book.AbstractPaymentCommand.execute(AbstractPaymentCommand.java:144",
33
+ "at com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:182)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.validate(DefaultOmpProcessor.java:67)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.doValidate(BaseBookPaymentVerifyCommand.java:314)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.execute(BaseBookPaymentVerifyCommand.java:212",
34
+ "by CC clearing house: CommonErrors::MSTError:503",
35
+ "com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Card is on negative or block list",
36
+ "do not honor",
37
+ "error.:MessageReferenceId=UnknownMessageReferenceId.Exception=credit card transaction pickup",
38
+ "error.creditCardDeclined",
39
+ "error.creditCardDeclined. exceededCardLimit: Internal application error. :MessageReferenceId=UnknownMessageReferenceId. Exception=Credit card error status - LIMIT EXCEEDED(51). : CommonErrors::MSTError:886",
40
+ "error.creditCardDeclined: Internal application error",
41
+ "error.creditCardDeclined: Internal application error.:MessageReferenceId=UnknownMessageReferenceId",
42
+ "error.creditCardDeclined:Internal application",
43
+ "error.creditCardDeclined:Internal",
44
+ "expired card",
45
+ "hold card",
46
+ "holdcard",
47
+ "mystiquebooking",
48
+ "refused"
49
+ ]
50
+ end
51
+ end
52
+
53
+
@@ -0,0 +1,36 @@
1
+ module TeRex
2
+ module Train
3
+ CREDITSERVICE = [
4
+ "mystiquebooking",
5
+ "Payment Failure happened. Unsuccessful Payment.",
6
+ "Payment Failure happened. com.orbitz.tbs.model.txn.PaymentException: Bad Auth. Causing CreditAuthResult:Unknown could not identify\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.checkFailedAuth(DefaultOmpProcessor.java:180)\\n\\tat com.orbitz.tbs.host.txn.omp.DefaultOmpProcessor.validate(DefaultOmpProcessor.java:66)\\n\\tat com.orbitz.tbs.host.txn.command.book.BaseBookPaymentVerifyCommand.doValidate(BaseBookPaymentVerifyCommand.java:296",
7
+ "Payment Failure happened. com.orbitz.tbs.model.SystemException: Unknown exception caught stack is: com.orbitz.lapsang.http.client.HttpInvocationRequestException: Failed Lapsang Service Invocation. requestURL: http:\\/\\/amexapp01q.qa.orbitz.net\\/omp\\/payment\\/validate\\nrequestMethod: POST\\n\\tat com.orbitz.lapsang.http.client.AbstractHttpInvocationHandler.doObject(AbstractHttpInvocationHandler.java:330)\\n\\tat com.orbitz.lapsang.http.client.AbstractHttpInvocationHandler.invoke(AbstractHttpInvocationHandler.java:186",
8
+ "We're sorry our system can not authenticate the information you have provided. An information mismatch has occurred. Please verify your credit card and billing information are correct and try again.",
9
+ "error.fraud",
10
+ "error.fraud.aegis",
11
+ "error.fraud.aegis.connectionFailure",
12
+ "error.fraud.aegis.timeout",
13
+ "error.fraud.db",
14
+ "error.fraud.invalidRequest",
15
+ "error.fraud.lodging",
16
+ "error.fraud.lodging.connectionFailure",
17
+ "error.fraud.lodging.timeout",
18
+ "error.fraud.payment",
19
+ "error.fraud.payment.connectionFailure",
20
+ "error.fraud.payment.timeout",
21
+ "error.fraud.paymentVault",
22
+ "error.fraud.paymentVault.connectionFailure",
23
+ "error.fraud.paymentVault.timeout",
24
+ "error.fraud.user",
25
+ "error.fraud.user.connectionFailure",
26
+ "error.fraud.user.timeout",
27
+ "error.payment",
28
+ "error.payment.ConnectionFailure",
29
+ "error.payment.PPSTimeout",
30
+ "error.payment.invalidXML",
31
+ "error.paymentVault",
32
+ "error.paymentVaultAccess.unknown.err",
33
+ "error.processFail"
34
+ ]
35
+ end
36
+ end
@@ -0,0 +1,58 @@
1
+ module TeRex
2
+ module Train
3
+ UNEXPECTED = [
4
+ "3rd Party Error: Server responded with an error message.",
5
+ "AUTHENTICATION RECOVERABLE TravelNow.com cannot service this request. Authentication failure. (cid=; ipAddress= )",
6
+ "Access denied.",
7
+ "Bundle not found.",
8
+ "Cannot connect to MTS driver.",
9
+ "Connectivity or communication problem. Try the request again or contact us",
10
+ "EXCEPTION",
11
+ "Exception: java. lang. No Class Def Found Error: Could not initialize class com. hotels. framework. service. Service Locator",
12
+ "Failed Lapsang Service Invocation. requestURL: http:\\/\\/member-ws1-002.cpeg.orbitz.net:10005\\/members\\/legacy\\/RQST?username= \\nrequestMethod: GET SERVER_ERROR Failed Lapsang Service Invocation. requestURL: http:\\/\\/member-ws1-002.cpeg.orbitz.net:10005\\/members\\/legacy\\/RQST?username= \\nrequestMethod: GET",
13
+ "HRN_QUOTE_KEY_FAILURE",
14
+ "Internal Error: Unable to merge array into xml template. Error was thrown. (1)",
15
+ "Internal application error.:",
16
+ "Internal server error. SERVER_ERROR Internal server error.",
17
+ "No Response",
18
+ "PROCESS_FAIL",
19
+ "Please enter the correct access code.",
20
+ "Query could not be created or located in session",
21
+ "ROLLBACK_ON_TIMEOUT",
22
+ "Return threshold exceeded.",
23
+ "SYS_OFFLINE",
24
+ "Sorry. Connectivity or communication problem. Try the request again or contact us",
25
+ "Supplier communication problem",
26
+ "This request can not be processed. Verify if all information are correct and try again",
27
+ "This request can not be processed. Try again",
28
+ "UNAUTHORIZED_REQUESTS The client made a request for which it does not have authorization.",
29
+ "com.orbitz.tbs.model.SystemException: Unknown exception caught stack is: com.orbitz.lapsang.http.client.HttpInvocationRequestException: Failed Lapsang Service Invocation. requestURL: http://hbe-austin-axpt1-1.qa.orbitz.net:20201/hotel/book\\nrequestMethod",
30
+ "This request can not be processed",
31
+ "This request can not be processed. Verify if all information are correct and try again",
32
+ "TravelNow.com cannot service this request. Authentication failure. (cid= ipAddress= )",
33
+ "TravelNow.com was unable to appropriately create back-end information required for this request.",
34
+ "UNKNOWN",
35
+ "We're sorry but we're unable to process your request due to a backend connection failure. error.atlantis.connectionFailure",
36
+ "We're sorry but we're unable to process your request due to a backend timeout. error.atlantis.timeout",
37
+ "We're sorry but we're unable to process your request due to an unknown error. error.processFail:",
38
+ "We're sorry but we're unable to process your request due to an unknown error. error.atlantis",
39
+ "We're sorry but we're unable to process your request due to an unknown error. error.atlantis.invalidXML",
40
+ "We're sorry but we're unable to process your request due to an unknown error. error.processFail: Connectivity or communication problem with OMS Connectivity or communication problem. Try the request again. In the event of an unexpected outage this may be an extended period.",
41
+ "We're sorry but we're unable to process your request due to an unknown error. error.trip",
42
+ "We're sorry but we're unable to process your request due to an unknown error.",
43
+ "We're sorry an error occurred while you were managing your images. Please try again.",
44
+ "We're sorry but you cannot access this resource.",
45
+ "We're sorry but you don't have permission to run this report.",
46
+ "cannot service this request.",
47
+ "com.orbitz.tbs.model.SystemException: Unknown exception caught stack is: com.orbitz.command.CommandException: Unexpected error\\njava.lang.NoSuchMethodError: com.orbitz.proto.finance.fraudcheck.TransactionRequest$Builder.addHotelInfo(Lcom\\/orbitz\\/proto\\/finance\\/fraudcheck\\/HotelInfo$Builder;)Lcom\\/orbitz\\/proto\\/finance\\/fraudcheck\\/TransactionRequest$Builder;\\n\\n\\tat com.orbitz.command.CommandResponse.get(CommandResponse.java:49",
48
+ "com.orbitz.tbs.model.SystemException: Unknown exception caught stack is: com.orbitz.lapsang.http.client.HttpInvocationRequestException: Failed Lapsang Service Invocation. requestURL: http:\\/\\/amexapp07q.qa.orbitz.net:20201\\/hotel\\/book\\nrequestMethod: POST\\n\\tat com.orbitz.lapsang.http.client.AbstractHttpInvocationHandler.doObject(AbstractHttpInvocationHandler.java:330)\\n\\tat com.orbitz.lapsang.http.client.AbstractHttpInvocationHandler.invoke(AbstractHttpInvocationHandler.java:186",
49
+ "error. unknown: com. hotels. service. integration. javex. Javex Connection Exception: Javex Http Manager :: IO Exception Connection to supplier database was lost.",
50
+ "error.processFail",
51
+ "java.lang.NullPointerException SERVER_ERROR",
52
+ "null error. serverError: Generic Travel Server error Expedia server down",
53
+ "We're sorry but we're unable to process your request due to a backend connection failure.",
54
+ "We're sorry but we're unable to process your request due to a backend timeout",
55
+ "We're sorry but we're unable to process your request due to an unknown error."
56
+ ]
57
+ end
58
+ end
@@ -0,0 +1,11 @@
1
+ module TeRex
2
+ module Train
3
+ UNKNOWNERROR = %w(
4
+ unknown,
5
+ problem,
6
+ issue,
7
+ unseen,
8
+ suitcase empty
9
+ )
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  require_relative "../lib/te_rex"
2
- class TrainedBayesTest < MicroTest::Test
2
+ class TrainedBayesCancelPolicyTest < PryTest::Test
3
3
 
4
4
  #Dir["#{File.dirname(__FILE__)}/test_modules/**/*.rb"].each { |f| load(f) if !!(f =~ /^[^\.].+\.rb/)}
5
5
 
@@ -19,7 +19,7 @@ class TrainedBayesTest < MicroTest::Test
19
19
  @@norefund.each {|txt| @@cls.train("Nonrefund", txt) }
20
20
  @@unknown.each {|txt| @@cls.train("Unknown", txt) }
21
21
 
22
- test "Training Data Set Test: Random exact match sould classify correctly (but we are lenient on partrefund/refund)" do
22
+ test "Training Data CancelPolicy Set Test: Random exact match sould classify correctly (but we are lenient on partrefund/refund)" do
23
23
 
24
24
  s_refund = @@refund.sample
25
25
  s_partial = @@partrefund.sample
@@ -39,15 +39,15 @@ class TrainedBayesTest < MicroTest::Test
39
39
  assert s_unk1 == ["Unknown", "Waht?"]
40
40
 
41
41
  # We are lenient on Partrefund || Refund but we still want to see when it fails
42
- assert s_refund1 != ["Partrefund", "You may receive a partial refund"]
42
+ #assert s_refund1 != ["Partrefund", "You may receive a partial refund"]
43
43
  # We are lenient on Refund || Partrefund but we still want to see when it fails
44
- assert s_partial1 != ["Refund", "We are pleased to offer you a refund"]
44
+ #assert s_partial1 != ["Refund", "We are pleased to offer you a refund"]
45
45
  assert s_non1 != ["Unknown", "Waht?"]
46
46
  assert s_unk1 != ["Nonrefund", "Much apologies, no refund to you"]
47
47
  end
48
48
 
49
49
 
50
- test "Training Data Set Test: Non-canonical examples should classify correctly" do
50
+ test "Training Data Set CancelPolicy Test: Non-canonical examples should classify correctly" do
51
51
 
52
52
  refund_s1 = "You will get a full refund and free cancellation"
53
53
  partrefund_s1 = "You will get a refund if you cancel or change your reservation before 0201 AM on 01/31/14"
@@ -65,7 +65,7 @@ class TrainedBayesTest < MicroTest::Test
65
65
  assert unk_s11 == ["Unknown", "Waht?"]
66
66
  end
67
67
 
68
- test "Training Data Set Test: Micro examples should return correct classification" do
68
+ test "Training Data Set CancelPolicy Test: Micro examples should return correct classification" do
69
69
 
70
70
  s1 = "free cancellation"
71
71
  s2 = "If you cancel or change your reservation before"
@@ -88,7 +88,7 @@ class TrainedBayesTest < MicroTest::Test
88
88
  assert s44 != ["Refund", "We are pleased to offer you a refund"]
89
89
  end
90
90
 
91
- test "Training Data Set Test: Micro examples should NOT match fake classes" do
91
+ test "Training Data Set CancelPolicy Test: Micro examples should NOT match fake classes" do
92
92
 
93
93
  s1 = "free cancellation"
94
94
  s2 = "partial refund"
@@ -106,7 +106,7 @@ class TrainedBayesTest < MicroTest::Test
106
106
  assert s44 != ["Sports", "sports yay!"]
107
107
  end
108
108
 
109
- test "Training Data Set Test: Ambiguous examples should return 'Unknown'" do
109
+ test "Training Data Set CancelPolicy Test: Ambiguous examples should return 'Unknown'" do
110
110
 
111
111
  s1 = "gobbly goop droop blithely toadwakle Grimpleshtein uf Varendorrf vun muscilaty"
112
112
  s2 = "The United States announced on Tuesday it will send 3,000 troops to help tackle the Ebola outbreak as part of a ramped-up plan, including a major deployment in Liberia."
@@ -124,7 +124,7 @@ class TrainedBayesTest < MicroTest::Test
124
124
  assert s44 == ["Unknown", "Waht?"]
125
125
  end
126
126
 
127
- test "Training Data Set Test: Category counts are equivalent with number of training data per class" do
127
+ test "Training Data Set CancelPolicy Test: Category counts are equivalent with number of training data per class" do
128
128
 
129
129
  assert @@cls.category_counts[:Refund] == @@refund.count
130
130
  assert @@cls.category_counts[:Partrefund] == @@partrefund.count
@@ -0,0 +1,162 @@
1
+ require_relative "../lib/te_rex"
2
+ class TrainedBayesProviderErrorsTest < PryTest::Test
3
+
4
+ @@avail = TeRex::Train::AVAIL
5
+ @@book = TeRex::Train::BOOK
6
+ @@cancel = TeRex::Train::CANCEL
7
+ @@cancel_forbidden = TeRex::Train::CANCELFORBIDDEN
8
+ @@credit_data = TeRex::Train::CREDITDATA
9
+ @@credit_decline = TeRex::Train::CREDITDECLINE
10
+ @@credit_service = TeRex::Train::CREDITSERVICE
11
+ @@unexpected = TeRex::Train::UNEXPECTED
12
+ #@@unk = TeRex::Train::UNKNOWNERROR
13
+
14
+ @@cls = TeRex::Classifier::Bayes.new(
15
+ {:tag => "AvailabilityError", :msg => "No hotel or room availability for request."},
16
+ {:tag => "BookingError", :msg => "Error processing Booking Request"},
17
+ {:tag => "CancelError", :msg => "Check data entry for Cancellation Request"},
18
+ {:tag => "CancelForbiddenError", :msg => "Cancellation forbidden"},
19
+ {:tag => "CreditDataError", :msg => "Credit Card data is invalid"},
20
+ {:tag => "CreditDeclineError", :msg => "Waht? Credit Card declined!"},
21
+ {:tag => "CreditServiceError", :msg => "External service problem processing"},
22
+ {:tag => "UnexpectedResponseError", :msg => "Unexpected response"}
23
+ #{:tag => "UnknownError", :msg => "Unexpected response"},
24
+ )
25
+ @@avail.each {|txt| @@cls.train("AvailabilityError", txt) }
26
+ @@book.each {|txt| @@cls.train("BookingError", txt) }
27
+ @@cancel.each {|txt| @@cls.train("CancelError", txt) }
28
+ @@cancel_forbidden.each {|txt| @@cls.train("CancelForbiddenError", txt) }
29
+ @@credit_data.each {|txt| @@cls.train("CreditDataError", txt) }
30
+ @@credit_decline.each {|txt| @@cls.train("CreditDeclineError", txt) }
31
+ @@credit_service.each {|txt| @@cls.train("CreditServiceError", txt) }
32
+ @@unexpected.each {|txt| @@cls.train("UnexpectedResponseError", txt) }
33
+ #@@unk.each {|txt| @@cls.train("UnknownError", txt) }
34
+
35
+
36
+ test "Training Data Provider Errors Set Test: Random exact match sould classify correctly" do
37
+
38
+ s_avail = @@avail.sample
39
+ s_book = @@book.sample
40
+ s_cancel = @@cancel.sample
41
+ s_cancel_forbidden = @@cancel_forbidden.sample
42
+ s_credit_data = @@credit_data.sample
43
+ s_credit_decline = @@credit_decline.sample
44
+ s_credit_service = @@credit_service.sample
45
+ s_unexpected = @@unexpected.sample
46
+
47
+ s_avail1 = @@cls.classify(s_avail)
48
+ s_book1 = @@cls.classify(s_book)
49
+ s_cancel1 = @@cls.classify(s_cancel)
50
+ s_cancel_forbidden1= @@cls.classify(s_cancel_forbidden)
51
+ s_credit_data1 = @@cls.classify(s_credit_data)
52
+ s_credit_decline1 = @@cls.classify(s_credit_decline)
53
+ s_credit_service1 = @@cls.classify(s_credit_service)
54
+ s_unexpected1 = @@cls.classify(s_unexpected)
55
+
56
+ assert s_avail1 == ["AvailabilityError", "No hotel or room availability for request."]
57
+ assert s_book1 == ["BookingError", "Error processing Booking Request"]
58
+ assert s_cancel1 == ["CancelError", "Check data entry for Cancellation Request"]
59
+ assert s_cancel_forbidden1 == ["CancelForbiddenError", "Cancellation forbidden"]
60
+ assert s_credit_data1 == ["CreditDataError", "Credit Card data is invalid"] || ["CreditServiceError", "External service problem processing"]
61
+ assert s_credit_decline1 == ["CreditDeclineError", "Waht? Credit Card declined!"]
62
+ assert s_credit_service1 == ["CreditServiceError", "External service problem processing"] || ["CreditDataError", "Credit Card data is invalid"]
63
+ assert s_unexpected1 == ["UnexpectedResponseError", "Unexpected response"]
64
+ end
65
+
66
+
67
+ # test "Training Data Set Test: cancel-cacancelical examples should classify correctly" do
68
+ #
69
+ # avail_s1 = "You will get a full avail and free cancellation"
70
+ # partavail_s1 = "You will get a avail if you cancel or change your reservation before 0201 AM on 01/31/14"
71
+ # noavail_s1 = "You will get a cancel-avail"
72
+ # cancel_forbidden_s1 = "You will get a cancelsense am I writing here."
73
+ #
74
+ # avail_s11 = @@cls.classify(avail_s1)
75
+ # partavail_s11 = @@cls.classify(partavail_s1)
76
+ # noavail_s11 = @@cls.classify(noavail_s1)
77
+ # cancel_forbidden_s11 = @@cls.classify(cancel_forbidden_s1)
78
+ #
79
+ # assert avail_s11 == ["avail", "We are pleased to offer you a avail"]
80
+ # assert partavail_s11 == ["Partavail", "You may receive a book avail"]
81
+ # assert noavail_s11 == ["cancelavail", "Much apologies, no avail to you"]
82
+ # assert cancel_forbidden_s11 == ["cancel_forbiddennown", "Waht?"]
83
+ # end
84
+ #
85
+ # test "Training Data Set Test: Micro examples should return correct classification" do
86
+ #
87
+ # s1 = "free cancellation"
88
+ # s2 = "If you cancel or change your reservation before"
89
+ # s3 = "cancel-avail"
90
+ # s4 = "policy rate validated."
91
+ #
92
+ # s11 = @@cls.classify(s1)
93
+ # s22 = @@cls.classify(s2)
94
+ # s33 = @@cls.classify(s3)
95
+ # s44 = @@cls.classify(s4)
96
+ #
97
+ # assert s11 == ["avail", "We are pleased to offer you a avail"]
98
+ # assert s22 == ["Partavail", "You may receive a book avail"]
99
+ # assert s33 == ["cancelavail", "Much apologies, no avail to you"]
100
+ # assert s44 == ["cancel_forbiddennown", "Waht?"]
101
+ #
102
+ # assert s11 != ["Partavail", "You may receive a book avail"]
103
+ # assert s22 != ["cancelavail", "Much apologies, no avail to you"]
104
+ # assert s33 != ["cancel_forbiddennown", "Waht?"]
105
+ # assert s44 != ["avail", "We are pleased to offer you a avail"]
106
+ # end
107
+ #
108
+ # test "Training Data Set Test: Micro examples should NOT match fake classes" do
109
+ #
110
+ # s1 = "free cancellation"
111
+ # s2 = "book avail"
112
+ # s3 = "no avail"
113
+ # s4 = "policy rate validated."
114
+ #
115
+ # s11 = @@cls.classify(s1)
116
+ # s22 = @@cls.classify(s2)
117
+ # s33 = @@cls.classify(s3)
118
+ # s44 = @@cls.classify(s4)
119
+ #
120
+ # assert s11 != ["Computers", "computers yay!"]
121
+ # assert s22 != ["Science", "science yay!"]
122
+ # assert s33 != ["Entertainment", "entertainment yay!"]
123
+ # assert s44 != ["Sports", "sports yay!"]
124
+ # end
125
+ #
126
+ # test "Training Data Set Test: Ambiguous examples should return 'cancel_forbiddennown'" do
127
+ #
128
+ # s1 = "gobbly goop droop blithely toadwakle Grimpleshtein uf Varendorrf vun muscilaty"
129
+ # s2 = "The United States announced on Tuesday it will send 3,000 troops to help tackle the Ebola outbreak as part of a ramped-up plan, including a major deployment in Liberia."
130
+ # s3 = "United Parcel Service Inc is almost doubling the number of seasonal employees it hires for this year's holiday shopping season as it aims to avoid a repeat of last year's network breakdown."
131
+ # s4 = "Alberto Contador wrapped up his third Vuelta a España triumph when he comfortably held on to his overall lead in the 21st and final stage time trial in a rain-soaked Santiago de Compostela on Sunday."
132
+ #
133
+ # s11 = @@cls.classify(s1)
134
+ # s22 = @@cls.classify(s2)
135
+ # s33 = @@cls.classify(s3)
136
+ # s44 = @@cls.classify(s4)
137
+ #
138
+ # assert s11 == ["cancel_forbiddennown", "Waht?"]
139
+ # assert s22 == ["cancel_forbiddennown", "Waht?"]
140
+ # assert s33 == ["cancel_forbiddennown", "Waht?"]
141
+ # assert s44 == ["cancel_forbiddennown", "Waht?"]
142
+ # end
143
+ #
144
+ # test "Training Data Set Test: Category counts are equivalent with number of training data per class" do
145
+ #
146
+ # assert @@cls.category_counts[:avail] == @@avail.count
147
+ # assert @@cls.category_counts[:Partavail] == @@partavail.count
148
+ # assert @@cls.category_counts[:cancelavail] == @@noavail.count
149
+ # assert @@cls.category_counts[:cancel_forbiddennown] == @@cancel_forbiddennown.count
150
+ #
151
+ # end
152
+ #
153
+ # test "Sparse Data Set Test: Training categories should NOT be undertrained... except 'cancel_forbiddennown'" do
154
+ # info = @@cls.training_description
155
+ # puts "\nUndertraining data for SPARSE DATA SET: #{info}"
156
+ # res = @@cls.under_trained?
157
+ # assert res[0].include? :cancel_forbiddennown
158
+ # end
159
+
160
+ end
161
+
162
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: te_rex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Bowles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2014-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast-stemmer
@@ -71,25 +71,25 @@ dependencies:
71
71
  - !ruby/object:Gem::Version
72
72
  version: 10.3.2
73
73
  - !ruby/object:Gem::Dependency
74
- name: micro_test
74
+ name: pry-test
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '0.4'
79
+ version: '0.5'
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.4.4
82
+ version: 0.5.5
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.4'
89
+ version: '0.5'
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
- version: 0.4.4
92
+ version: 0.5.5
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: pry
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -172,11 +172,21 @@ files:
172
172
  - test/bayes_data_test.rb
173
173
  - test/corpus_test.rb
174
174
  - test/sparse_bayes_test.rb
175
+ - test/test_modules/avail_train.rb
176
+ - test/test_modules/book_train.rb
177
+ - test/test_modules/cancel_forbidden_train.rb
178
+ - test/test_modules/cancel_train.rb
179
+ - test/test_modules/credit_data_train.rb
180
+ - test/test_modules/credit_decline_train.rb
181
+ - test/test_modules/credit_service_train.rb
175
182
  - test/test_modules/nonrefund.rb
176
183
  - test/test_modules/partrefund.rb
177
184
  - test/test_modules/refund.rb
185
+ - test/test_modules/unexpected_train.rb
178
186
  - test/test_modules/unknown.rb
179
- - test/trained_bayes_test.rb
187
+ - test/test_modules/unknown_error_train.rb
188
+ - test/trained_bayes_cancel_policy_test.rb
189
+ - test/trained_bayes_provider_errors_test.rb
180
190
  homepage: https://github.com/jbowles/te_rex
181
191
  licenses:
182
192
  - MIT
@@ -207,8 +217,19 @@ test_files:
207
217
  - test/bayes_data_test.rb
208
218
  - test/corpus_test.rb
209
219
  - test/sparse_bayes_test.rb
220
+ - test/test_modules/avail_train.rb
221
+ - test/test_modules/book_train.rb
222
+ - test/test_modules/cancel_forbidden_train.rb
223
+ - test/test_modules/cancel_train.rb
224
+ - test/test_modules/credit_data_train.rb
225
+ - test/test_modules/credit_decline_train.rb
226
+ - test/test_modules/credit_service_train.rb
210
227
  - test/test_modules/nonrefund.rb
211
228
  - test/test_modules/partrefund.rb
212
229
  - test/test_modules/refund.rb
230
+ - test/test_modules/unexpected_train.rb
213
231
  - test/test_modules/unknown.rb
214
- - test/trained_bayes_test.rb
232
+ - test/test_modules/unknown_error_train.rb
233
+ - test/trained_bayes_cancel_policy_test.rb
234
+ - test/trained_bayes_provider_errors_test.rb
235
+ has_rdoc: