Пример #1
0
 public function testUnknown()
 {
     $Corrector = new Geonames(array(0, 49.44, 49.441, 49.442, 49.443, 49.444, 49.445, 0, 0, 0, 0, 0, 0, 49.446, 49.447, 49.448, 49.449, 49.45), array(0, 7.76, 7.761, 7.762, 7.763, 7.764, 7.765, 0, 0, 0, 0, 0, 0, 7.766, 7.767, 7.768, 7.769, 7.77));
     if ($Corrector->canHandleData()) {
         try {
             $Corrector->correctElevation();
             $this->assertEquals(array(237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 248, 248, 248), $Corrector->getCorrectedElevation());
         } catch (\RuntimeException $Exception) {
             $this->markTestSkipped('Geonames.org was not able to handle the request. Exception occured: ' . $Exception->getMessage());
         }
     } else {
         $this->markTestSkipped('Geonames.org was not available.');
     }
 }
Пример #2
0
<?php

require_once './GeoNames_webservice/Geonames.php';
//require_once('./distance_estimation_webservice/distance_between_two_locations.php');
$geo = new Geonames();
//passthru('cat ./twitter_nlp-master/test.txt | python ./twitter_nlp-master/python/ner/extractEntities2.py --classify --chunk --pos',$result);
//$str=exec('python ./python.py',$result);
$str = exec('cat /home/fatma/twitter_data/twitter_nlp-master/temp_tweets.txt | python /home/fatma/twitter_data/twitter_nlp-master/python/ner/extractEntities2.py', $result);
try {
    $strTrafficStatus = $result[1];
    $strAdress = $result[0];
    $geo->getLatandLong($strAdress, "London,UK", $strTrafficStatus);
} catch (Exception $e) {
    error_log("Error with web service: " . $e->getMessage());
    //'&nelat='.$nelat.'&nelng='.$nelng.'&swlat='.$swlat.'&swlng='.$swlng.
}
?>


Пример #3
0
<?php

require_once './GeoNames_webservice/Geonames.php';
$geo = new Geonames();
//passthru('cat ./twitter_nlp-master/test.txt | python ./twitter_nlp-master/python/ner/extractEntities2.py --classify --chunk --pos',$result);
//$str=exec('python ./python.py',$result);
$str = exec('python /home/fatma/twitter_data/twitter_nlp-master/python/ner/extractEntities2.py', $result);
try {
    var_dump($result);
    $strTrafficStatus = $result[1];
    $strAdress = $result[0];
    $geo->getLatandLong($strAdress, "uk", $strTrafficStatus);
} catch (Exception $e) {
    error_log("Error with web service: " . $e->getMessage());
}
?>