separate Nacht-S-Bahn from S-Bahn

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@359 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-11-18 19:47:11 +00:00
parent f50dbbe78d
commit caf4ea9c87

View file

@ -583,7 +583,8 @@ public abstract class AbstractHafasProvider implements NetworkProvider
throw new IllegalArgumentException(location.type.toString());
}
private static final Pattern P_LINE_S = Pattern.compile("SN?\\d+");
private static final Pattern P_LINE_S = Pattern.compile("S\\d+");
private static final Pattern P_LINE_SN = Pattern.compile("SN\\d*");
private final String _normalizeLine(final String type, final String name, final String longCategory)
{
@ -648,6 +649,8 @@ public abstract class AbstractHafasProvider implements NetworkProvider
return "S" + normalizedName;
if (P_LINE_S.matcher(normalizedType).matches()) // diverse S-Bahnen
return "S" + normalizedType;
if (P_LINE_SN.matcher(normalizedType).matches()) // Nacht-S-Bahn
return "S" + normalizedType;
if ("Met".equals(normalizedType)) // Metro
return "U" + normalizedName;