Commit c94f9393 authored by Volker Krause's avatar Volker Krause
Browse files

Support German language variants of Thalys PDF tickets as well

parent 5adc6297
Pipeline #241670 passed with stage
in 4 minutes and 13 seconds
......@@ -60,15 +60,15 @@ function parsePdfTicket(pdf, node, triggerNode)
const page = pdf.pages[triggerNode.location];
var res = triggerNode.result[0];
const dep = page.textInRect(0.0, 0.15, 0.35, 0.3).match(/([\s\S]+)\nDÉPART À\n(\d\d:\d\d)/);
const dep = page.textInRect(0.0, 0.15, 0.35, 0.3).match(/([\s\S]+)\n(?:DÉPART À|ABFAHRT)\n(\d\d:\d\d)/);
res.reservationFor.departureStation.name = dep[1];
res.reservationFor.departureTime = res.reservationFor.departureDay.substr(0, 11) + dep[2];
const arr = page.textInRect(0.35, 0.15, 0.65, 0.3).match(/([\s\S]+)\nARRIVÉE À\n(\d\d:\d\d)/);
const arr = page.textInRect(0.35, 0.15, 0.65, 0.3).match(/([\s\S]+)\n(?:ARRIVÉE À|ANKUNFT)\n(\d\d:\d\d)/);
res.reservationFor.arrivalStation.name = arr[1];
res.reservationFor.arrivalTime = res.reservationFor.departureDay.substr(0, 11) + arr[2];
const passenger = page.text.match(/PASSAGER\n(.*)\n/);
const passenger = page.text.match(/(?:PASSAGER|FAHRGAST)\n(.*)\n/);
res.underName.name = passenger[1];
return res;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment