}
-function bySearchRank($a, $b)
-{
- if ($a['iSearchRank'] == $b['iSearchRank'])
- return strlen($a['sOperator']) + strlen($a['sHouseNumber']) - strlen($b['sOperator']) - strlen($b['sHouseNumber']);
- return ($a['iSearchRank'] < $b['iSearchRank']?-1:1);
-}
-
-
function byImportance($a, $b)
{
if ($a['importance'] != $b['importance'])
foreach ($aTokens as $sToken => $aWords) {
if ($aWords) {
foreach ($aWords as $aToken) {
- $aWordsIDs[$aToken['word_id']] = $sToken.'('.$aToken['word_id'].')';
+ $aWordsIDs[$aToken['word_id']] =
+ '#'.$sToken.'('.$aToken['word_id'].')#';
}
}
}
echo "<th>Lat</th><th>Lon</th><th>Radius</th></tr>";
foreach ($aData as $iRank => $aRankedSet) {
foreach ($aRankedSet as $aRow) {
- echo "<tr>";
- echo "<td>$iRank</td>";
-
- echo "<td>";
- $sSep = '';
- foreach ($aRow['aName'] as $iWordID) {
- echo $sSep.'#'.$aWordsIDs[$iWordID].'#';
- $sSep = ', ';
- }
- echo "</td>";
-
- echo "<td>";
- $sSep = '';
- foreach ($aRow['aNameNonSearch'] as $iWordID) {
- echo $sSep.'#'.$aWordsIDs[$iWordID].'#';
- $sSep = ', ';
- }
- echo "</td>";
-
- echo "<td>";
- $sSep = '';
- foreach ($aRow['aAddress'] as $iWordID) {
- echo $sSep.'#'.$aWordsIDs[$iWordID].'#';
- $sSep = ', ';
- }
- echo "</td>";
-
- echo "<td>";
- $sSep = '';
- foreach ($aRow['aAddressNonSearch'] as $iWordID) {
- echo $sSep.'#'.$aWordsIDs[$iWordID].'#';
- $sSep = ', ';
- }
- echo "</td>";
-
- echo "<td>".$aRow['sCountryCode']."</td>";
-
- echo "<td>".$aRow['sOperator']."</td>";
- echo "<td>".$aRow['sClass']."</td>";
- echo "<td>".$aRow['sType']."</td>";
-
- echo "<td>".$aRow['sPostcode']."</td>";
- echo "<td>".$aRow['sHouseNumber']."</td>";
-
- if ($aRow['oNear']) {
- echo "<td>".$aRow['oNear']->lat()."</td>";
- echo "<td>".$aRow['oNear']->lon()."</td>";
- echo "<td>".$aRow['oNear']->radius()."</td>";
- } else {
- echo "<td></td><td></td><td></td>";
- }
-
- echo "</tr>";
+ $aRow->dumpAsHtmlTableRow($aWordsIDs);
}
}
echo "</table>";