mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
tidy up lines of Karlsruhe
This commit is contained in:
parent
927a83a86e
commit
64ff4cf4cd
1 changed files with 8 additions and 2 deletions
|
@ -19,6 +19,8 @@ package de.schildbach.pte;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Style;
|
import de.schildbach.pte.dto.Style;
|
||||||
import de.schildbach.pte.dto.Style.Shape;
|
import de.schildbach.pte.dto.Style.Shape;
|
||||||
|
@ -57,13 +59,17 @@ public class KvvProvider extends AbstractEfaProvider
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern P_LINE = Pattern.compile("(.*?)\\s+\\([\\w/]+\\)", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String parseLine(final String mot, final String name, final String longName, final String noTrainName)
|
protected String parseLine(final String mot, final String name, final String longName, final String noTrainName)
|
||||||
{
|
{
|
||||||
if (name.endsWith(" (VBK)")) // Verkehrsbetriebe Karlsruhe
|
final Matcher m = P_LINE.matcher(name);
|
||||||
return super.parseLine(mot, name.substring(0, name.length() - 6), longName, noTrainName);
|
if (m.matches())
|
||||||
|
return super.parseLine(mot, m.group(1), longName, noTrainName);
|
||||||
else
|
else
|
||||||
return super.parseLine(mot, name, longName, noTrainName);
|
return super.parseLine(mot, name, longName, noTrainName);
|
||||||
|
// TODO check for " (Ersatzverkehr)"
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue