用sed检测字符串的语言

・1 分钟阅读

检测字符串的语言

detectlanguage(){ curl -s"http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&q=$@" | sed 's/{"responseData": {"language":"([^"]*)".*/1n/'; }
用法:detectlanguage <phrase>例子:detectlanguage hola
Hujiuxiang profile image