2015-12-27 39 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将而不是返回信息,如口语,货币等。它的焦点在地理位置(坐标,州,县等),并提供几种语言的地名。