Correct spelling errors in stop names
This commit is contained in:
parent
580e637f8a
commit
ef90fd2fca
2 changed files with 20 additions and 16 deletions
|
@ -8,6 +8,10 @@
|
||||||
protected $fullName;
|
protected $fullName;
|
||||||
protected $location;
|
protected $location;
|
||||||
|
|
||||||
|
public static function sanitizeName($name) {
|
||||||
|
return preg_replace("~(^| )'?T($| )~", '$1\'t$2', $name);
|
||||||
|
}
|
||||||
|
|
||||||
public function __toString () {
|
public function __toString () {
|
||||||
return 'PTStop[' . $this->ref . ']';
|
return 'PTStop[' . $this->ref . ']';
|
||||||
}
|
}
|
||||||
|
@ -41,8 +45,8 @@
|
||||||
$this->exists = !is_null($response);
|
$this->exists = !is_null($response);
|
||||||
|
|
||||||
$this->municipality = $response['omschrijvingGemeente'];
|
$this->municipality = $response['omschrijvingGemeente'];
|
||||||
$this->name = $response['omschrijvingKort'];
|
$this->name = static::sanitizeName($response['omschrijvingKort']);
|
||||||
$this->fullName = $response['omschrijvingLang'];
|
$this->fullName = static::sanitizeName($response['omschrijvingLang']);
|
||||||
$this->location = array(floatval($response['coordinaat']['lt']), floatval($response['coordinaat']['ln']));
|
$this->location = array(floatval($response['coordinaat']['lt']), floatval($response['coordinaat']['ln']));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
echo '<a href="?h=' . rawurlencode($stop['halteNummer']) . '" class="result stop">';
|
echo '<a href="?h=' . rawurlencode($stop['halteNummer']) . '" class="result stop">';
|
||||||
|
|
||||||
echo '<span class="name">' . $stop['omschrijvingLang'] . '</span> ';
|
echo '<span class="name">' . PTStop::sanitizeName($stop['omschrijvingLang']) . '</span> ';
|
||||||
echo '<span class="ref">(' . $stop['halteNummer'] . ')</span>';
|
echo '<span class="ref">(' . $stop['halteNummer'] . ')</span>';
|
||||||
if (isset($stop['bestemmingen'][0])) {
|
if (isset($stop['bestemmingen'][0])) {
|
||||||
echo '<span class="dest"><span class="deemphasize">richting</span> ' . parent::listify($stop['bestemmingen']) . '</span>';
|
echo '<span class="dest"><span class="deemphasize">richting</span> ' . parent::listify($stop['bestemmingen']) . '</span>';
|
||||||
|
|
Loading…
Reference in a new issue