mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 15:58:49 +00:00
lines in russia
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@44 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
7edf771289
commit
83c130696b
1 changed files with 5 additions and 0 deletions
|
@ -483,6 +483,7 @@ public final class BahnProvider implements NetworkProvider
|
|||
}
|
||||
|
||||
private static final Pattern P_NORMALIZE_LINE = Pattern.compile("([A-Za-zÄÖÜäöüß]+)[\\s-]*(.*)");
|
||||
private static final Pattern P_NORMALIZE_LINE_RUSSIA = Pattern.compile("(?:D\\s*)?(\\d{1,3}[A-Z]{2})");
|
||||
private static final Pattern P_NORMALIZE_LINE_SBAHN = Pattern.compile("S\\w*\\d+");
|
||||
private static final Pattern P_NORMALIZE_LINE_NUMBER = Pattern.compile("\\d{4,5}");
|
||||
|
||||
|
@ -495,6 +496,10 @@ public final class BahnProvider implements NetworkProvider
|
|||
if (line == null || line.length() == 0)
|
||||
return null;
|
||||
|
||||
final Matcher mRussia = P_NORMALIZE_LINE_RUSSIA.matcher(line);
|
||||
if (mRussia.matches())
|
||||
return "R" + mRussia.group(1);
|
||||
|
||||
final Matcher m = P_NORMALIZE_LINE.matcher(line);
|
||||
if (m.matches())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue