line with just numbers

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@830 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-10-15 22:40:55 +00:00
parent 40b46a4c14
commit e29c0eb649

View file

@ -19,7 +19,9 @@ package de.schildbach.pte;
import java.io.IOException;
import java.util.List;
import java.util.regex.Pattern;
import de.schildbach.pte.dto.Line;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
import de.schildbach.pte.dto.NearbyStationsResult;
@ -142,6 +144,17 @@ public class NasaProvider extends AbstractHafasProvider
return xmlMLcReq(constraint);
}
private static final Pattern P_LINE_NUMBER = Pattern.compile("\\d{4,}");
@Override
protected Line normalizeLine(final String line)
{
if (P_LINE_NUMBER.matcher(line).matches())
return newLine('?' + line);
return super.normalizeLine(line);
}
@Override
protected char normalizeType(String type)
{