2015-12-27 96 views
1

如何使用YQL獲取國家的口語?從雅虎獲取口語語言

我的做法是:

select lang from geo.countries where name ="Italy" 

但我總是得到英語作爲語言:

{ 
"query": { 
    "count": 1, 
    "created": "2015-12-27T23:43:58Z", 
    "lang": "en-US", 
    "diagnostics": { 
    "publiclyCallable": "true", 
    "url": { 
    "execution-start-time": "28", 
    "execution-stop-time": "98", 
    "execution-time": "70", 
    "content": "http://wws.geotech.yahooapis.com/v1/countries;start=0;count=1000" 
    }, 
    "user-time": "103", 
    "service-time": "70", 
    "build-version": "0.2.369" 
    }, 
    "results": { 
    "place": { 
    "lang": "en-US" // wrong language! 
    } 
    } 
} 
} 

在這裏,你可以玩的YQL控制檯:https://developer.yahoo.com/yql/console/#h=select+lang+from+geo.countries+where+name+%3D%22Italy%22

回答

0

根據documentationlang不是口語。

header部分用於標識請求響應中的語言。

results中,它用於標識哪種語言用於描述該地點的本地化名稱。

恐怕GeoPlanet API將而不是返回信息,如口語,貨幣等。它的焦點在地理位置(座標,州,縣等),並提供幾種語言的地名。