Commit 8ecaf8e5 authored by Volker Krause's avatar Volker Krause
Browse files

Remove now unneeded extractor script code

The generic boarding pass extractors takes care of this.
parent 0c4cc76b
Pipeline #76996 passed with stage
in 13 minutes and 30 seconds
......@@ -14,11 +14,6 @@ function main(pdf, node, triggerNode) {
res.reservationFor.departureTime = JsonLd.toDateTime(date[1] + depTime[1], "dd MMM yyhh:mm", "en");
var boardingTime = page.text.match(/Boarding Time\s+(\d\d:\d\d)/);
res.reservationFor.boardingTime = JsonLd.toDateTime(date[1] + boardingTime[1], "dd MMM yyhh:mm", "en");
var from = page.text.match(/From +(\S.+?)(?:\(|To|\s\s)/);
res.reservationFor.departureAirport.name = from[1];
var to = page.text.match(/To +(\S.+?)(?:\(|\s\s)/);
res.reservationFor.arrivalAirport.name = to[1];
return res;
}
......
......@@ -4,17 +4,12 @@
*/
function parseBoardingPass(pdf, node, triggerNode) {
console.log(pdf);
var res = triggerNode.result[0];
const page = pdf.pages[triggerNode.location];
const timesText = page.textInRect(0.5, 0.5, 1, 1);
console.log(timesText);
const times = timesText.match(/\n(\d\d:\d\d)[\s\S]*?\n(\d\d:\d\d)[\s\S]*?\n(\d\d:\d\d)[\s\S]*?\n(\d\d:\d\d)[\s\S]*?\d\d:\d\d\./);
res.reservationFor.boardingTime = JsonLd.toDateTime(times[2], "hh:mm", "en");
res.reservationFor.departureTime = JsonLd.toDateTime(times[3], "hh:mm", "en");
res.reservationFor.arrivalTime = JsonLd.toDateTime(times[4], "hh:mm", "en");
res.reservationFor.departureAirport.name = page.textInRect(0.5, 0.3, 0.75, 0.375);
res.reservationFor.arrivalAirport.name = page.textInRect(0.75, 0.3, 1, 0.375);
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