mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 00:08:47 +00:00
return simple positions
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@526 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
443abfedb7
commit
2ae8be945b
3 changed files with 12 additions and 10 deletions
|
@ -1568,7 +1568,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
return Currency.getInstance(currencyStr);
|
||||
}
|
||||
|
||||
private static final Pattern P_PLATFORM_GLEIS = Pattern.compile("Gleis (\\d+[a-z]?)(?: ([A-Z])\\s*-\\s*([A-Z]))?");
|
||||
private static final Pattern P_PLATFORM_GLEIS = Pattern.compile("(Gleis|Bstg\\.)\\s*(\\d+[a-z]?)(?: ([A-Z])\\s*-\\s*([A-Z]))?");
|
||||
|
||||
private static final String normalizePlatform(final String platform, final String platformName)
|
||||
{
|
||||
|
@ -1577,10 +1577,12 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
final Matcher mGleis = P_PLATFORM_GLEIS.matcher(platformName);
|
||||
if (mGleis.matches())
|
||||
{
|
||||
if (mGleis.group(2) == null)
|
||||
return "Gl. " + mGleis.group(1);
|
||||
if (mGleis.group(3) == null)
|
||||
return mGleis.group(2);
|
||||
else if (mGleis.group(1).equals("Gleis"))
|
||||
return "Gl. " + mGleis.group(2) + " " + mGleis.group(3) + "-" + mGleis.group(4);
|
||||
else
|
||||
return "Gl. " + mGleis.group(1) + " " + mGleis.group(2) + "-" + mGleis.group(3);
|
||||
return mGleis.group(1) + " " + mGleis.group(2) + " " + mGleis.group(3) + "-" + mGleis.group(4);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -291,11 +291,11 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
+ "(?:" //
|
||||
+ "<span class=\"bold\">\\s*(.+?)\\s*</span>.*?" // line
|
||||
+ "ab\\s+(?:<span[^>]*>.*?</span>)?\\s*(\\d{1,2}:\\d{2})\\s*(?:<span[^>]*>.*?</span>)?" // departureTime
|
||||
+ "\\s*(Gl\\. .+?)?\\s*\n" // departurePosition
|
||||
+ "\\s*(?:Gl\\. (.+?))?\\s*\n" // departurePosition
|
||||
+ "am\\s+(\\d{2}\\.\\d{2}\\.\\d{2}).*?" // departureDate
|
||||
+ "<span class=\"bold\">\\s*(.+?)\\s*</span><br />.*?" // arrival
|
||||
+ "an\\s+(?:<span[^>]*>.*?</span>)?\\s*(\\d{1,2}:\\d{2})\\s*(?:<span[^>]*>.*?</span>)?" // arrivalTime
|
||||
+ "\\s*(Gl\\. .+?)?\\s*\n" // arrivalPosition
|
||||
+ "\\s*(?:Gl\\. (.+?))?\\s*\n" // arrivalPosition
|
||||
+ "am\\s+(\\d{2}\\.\\d{2}\\.\\d{2}).*?" // arrivalDate
|
||||
+ "|" //
|
||||
+ "(\\d+) Min\\..*?" // footway
|
||||
|
@ -355,7 +355,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
final Date departureTime = ParserUtils.parseTime(mDetFine.group(3));
|
||||
|
||||
final String departurePosition = mDetFine.group(4) != null ? ParserUtils.resolveEntities(mDetFine.group(4)) : null;
|
||||
final String departurePosition = ParserUtils.resolveEntities(mDetFine.group(4));
|
||||
|
||||
final Date departureDate = ParserUtils.parseDate(mDetFine.group(5));
|
||||
|
||||
|
@ -363,7 +363,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
final Date arrivalTime = ParserUtils.parseTime(mDetFine.group(7));
|
||||
|
||||
final String arrivalPosition = mDetFine.group(8) != null ? ParserUtils.resolveEntities(mDetFine.group(8)) : null;
|
||||
final String arrivalPosition = ParserUtils.resolveEntities(mDetFine.group(8));
|
||||
|
||||
final Date arrivalDate = ParserUtils.parseDate(mDetFine.group(9));
|
||||
|
||||
|
|
|
@ -436,11 +436,11 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
+ ")?.*?" //
|
||||
+ "(?:" //
|
||||
+ "ab (\\d+:\\d+)\n" // departureTime
|
||||
+ "(Gl\\. \\d+)?.*?" // departurePosition
|
||||
+ "(?:Gl\\. (.+?))?.*?" // departurePosition
|
||||
+ "<strong>\\s*(.*?)\\s*</strong>.*?" // line
|
||||
+ "Ri\\. (.*?)[\n\\.]*<.*?" // destination
|
||||
+ "an (\\d+:\\d+)\n" // arrivalTime
|
||||
+ "(Gl\\. \\d+)?.*?" // arrivalPosition
|
||||
+ "(?:Gl\\. (.+?))?.*?" // arrivalPosition
|
||||
+ "<a href=\"/Fahrinfo[^\"]*?input=(\\d+)\">\n" // arrivalId
|
||||
+ "<strong>([^<]*)</strong>" // arrivalName
|
||||
+ "|" //
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue