]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
remove check for class/type shortcuts which were never implemented
[nominatim.git] / lib / lib.php
index 1b499005d7d73ffa40f9b37a70a569859049d928..2f94c25cf7c7d8eab011cdd46a6691954b77a933 100644 (file)
                return $aResult;
        }
 
+       function getInverseWordSets($aWords, $iDepth)
+       {
+               $aResult = array(array(join(' ',$aWords)));
+               $sFirstToken = '';
+               if ($iDepth < 8)
+               {
+                       while(sizeof($aWords) > 1)
+                       {
+                               $sWord = array_pop($aWords);
+                               $sFirstToken = $sWord.($sFirstToken?' ':'').$sFirstToken;
+                               $aRest = getInverseWordSets($aWords, $iDepth+1);
+                               foreach($aRest as $aSet)
+                               {
+                                       $aResult[] = array_merge(array($sFirstToken),$aSet);
+                               }
+                       }
+               }
+               return $aResult;
+       }
+
 
        function getTokensFromSets($aSets)
        {
  'landuse:farm' => array('label'=>'Farm','frequency'=>1201,'icon'=>'', 'defdiameter' => 0.02,),
  'place:farm' => array('label'=>'Farm','frequency'=>1162,'icon'=>'', 'defdiameter' => 0.02,),
 
- 'highway:motorway_junction' => array('label'=>'Motorway Junction','frequency'=>1126,'icon'=>'','simplelabel'=>'Road',),
+ 'highway:motorway_junction' => array('label'=>'Motorway Junction','frequency'=>1126,'icon'=>'','simplelabel'=>'Junction',),
  'highway:motorway' => array('label'=>'Motorway','frequency'=>4627,'icon'=>'','simplelabel'=>'Road',),
  'highway:trunk' => array('label'=>'Trunk','frequency'=>23084,'icon'=>'','simplelabel'=>'Road',),
  'highway:primary' => array('label'=>'Primary','frequency'=>32138,'icon'=>'','simplelabel'=>'Road',),
  'shop:electronics' => array('label'=>'Electronics','frequency'=>96,'icon'=>'',),
  'shop:department_store' => array('label'=>'Department Store','frequency'=>86,'icon'=>'',),
  'shop:books' => array('label'=>'Books','frequency'=>85,'icon'=>'',),
- 'shop:yes' => array('label'=>'Yes','frequency'=>68,'icon'=>'',),
+ 'shop:yes' => array('label'=>'Shop','frequency'=>68,'icon'=>'',),
  'shop:outdoor' => array('label'=>'Outdoor','frequency'=>67,'icon'=>'',),
  'shop:mall' => array('label'=>'Mall','frequency'=>63,'icon'=>'',),
  'shop:florist' => array('label'=>'Florist','frequency'=>61,'icon'=>'',),
  'historic:roman_road' => array('label'=>'Roman Road','frequency'=>27,'icon'=>'',),
  'historic:fort' => array('label'=>'Fort','frequency'=>26,'icon'=>'',),
  'railway:subway_entrance' => array('label'=>'Subway Entrance','frequency'=>26,'icon'=>'',),
- 'historic:yes' => array('label'=>'Yes','frequency'=>25,'icon'=>'',),
+ 'historic:yes' => array('label'=>'Historic','frequency'=>25,'icon'=>'',),
  'highway:gate' => array('label'=>'Gate','frequency'=>25,'icon'=>'',),
  'leisure:fishing' => array('label'=>'Fishing','frequency'=>24,'icon'=>'',),
  'historic:museum' => array('label'=>'Museum','frequency'=>24,'icon'=>'',),
 
  'place:houses' => array('label'=>'Houses','frequency'=>85,'icon'=>'',),
  'railway:preserved' => array('label'=>'Preserved','frequency'=>227,'icon'=>'',),
- 'waterway:derelict canal' => array('label'=>'Derelict Canal','frequency'=>21,'icon'=>'',),
+ 'waterway:derelict_canal' => array('label'=>'Derelict Canal','frequency'=>21,'icon'=>'',),
  'amenity:dead_pub' => array('label'=>'Dead Pub','frequency'=>20,'icon'=>'',),
  'railway:disused_station' => array('label'=>'Disused Station','frequency'=>114,'icon'=>'',),
  'railway:abandoned' => array('label'=>'Abandoned','frequency'=>641,'icon'=>'',),
        function javascript_renderData($xVal)
        {
                header("Access-Control-Allow-Origin: *");
-               $jsonout = json_encode($xVal);
+               $iOptions = 0;
+               if (defined('PHP_VERSION_ID') && PHP_VERSION_ID > 50400)
+                       $iOptions = JSON_UNESCAPED_UNICODE;
+               $jsonout = json_encode($xVal, $iOptions);
 
                if( ! isset($_GET['json_callback']))
                {