mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 17:09:51 +00:00
strip operators from Zurich names
This commit is contained in:
parent
42a01f6560
commit
786d29ffc7
1 changed files with 17 additions and 1 deletions
|
@ -123,11 +123,27 @@ public class ZvvProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String[] OPERATORS = { "SBB", "SZU" };
|
||||||
private static final String[] PLACES = { "Zürich", "Winterthur" };
|
private static final String[] PLACES = { "Zürich", "Winterthur" };
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] splitPlaceAndName(final String name)
|
protected String[] splitPlaceAndName(String name)
|
||||||
{
|
{
|
||||||
|
for (final String operator : OPERATORS)
|
||||||
|
{
|
||||||
|
if (name.endsWith(" " + operator))
|
||||||
|
{
|
||||||
|
name = name.substring(0, name.length() - operator.length() - 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.endsWith(" (" + operator + ")"))
|
||||||
|
{
|
||||||
|
name = name.substring(0, name.length() - operator.length() - 3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (final String place : PLACES)
|
for (final String place : PLACES)
|
||||||
{
|
{
|
||||||
if (name.startsWith(place + ", "))
|
if (name.startsWith(place + ", "))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue