mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
parse departure message for Germany
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@141 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
b9571a9399
commit
fc12d20236
6 changed files with 40 additions and 10 deletions
|
@ -450,6 +450,7 @@ public final class BahnProvider implements NetworkProvider
|
|||
+ ">>\n\\s*(.+?)\\s*\n<br />\n" // destination
|
||||
+ "<span class=\"bold\">(\\d{1,2}:\\d{2})</span>" // time
|
||||
+ "(?: <span class=\"[\\w ]*\">(?:(pünktl\\.)|ca. \\+(\\d+))</span>)?" // ontime, delay
|
||||
+ "(?:, <span class=\"red\">([^<]*)</span>)?" // (message)
|
||||
+ "(?:(?:, )?(Gl\\. " + ParserUtils.P_PLATFORM + "))?" // position
|
||||
, Pattern.DOTALL);
|
||||
private static final Pattern P_DEPARTURES_URI_STATION_ID = Pattern.compile("input=(\\d+)");
|
||||
|
@ -508,10 +509,12 @@ public final class BahnProvider implements NetworkProvider
|
|||
predictedTime = parsed.getTime();
|
||||
}
|
||||
|
||||
final String position = ParserUtils.resolveEntities(mDepFine.group(6));
|
||||
final String message = ParserUtils.resolveEntities(mDepFine.group(6));
|
||||
|
||||
final String position = ParserUtils.resolveEntities(mDepFine.group(7));
|
||||
|
||||
final Departure dep = new Departure(plannedTime, predictedTime, line, line != null ? LINES.get(line.charAt(0)) : null,
|
||||
position, 0, destination);
|
||||
position, 0, destination, message);
|
||||
if (!departures.contains(dep))
|
||||
departures.add(dep);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue