[[PageOutline(3-4, Sections)]] == !DetectLanguage == === Intro === detect language for given strings ---- === Description === '''struct !DetectLanguage(string $token, array($text, $text, ...) $data)''' Given an array of strings ''data'' the function will return a structure with detected languages for all the strings given as parameters. ---- === Parameters === {{{ struct( (string) [token], array( (string) [text], (string) [text], ... ) [data] ) }}} ''token (required)'':: token string identifying user's session, taken from [wiki:XmlRpcLogIn LogIn] output structure. ''data'':: * array of strings you want language detected for. * these strings should be gzipped (without header) and then base64-encoded (to improve transfer speed and save bandwidth). * strings should be at least 4096 bytes long for good results - but you can send the whole subtitle contents. ---- === Return Values === Output is returned in this structure: {{{ struct( (string) [status], struct( (string) [], (string) [], ... ) [data], (double) [seconds] ) }}} and contains these elements: ''status'':: function result code, see [wiki:XmlRpcStatusCode list of status codes] ''data'':: contains a structure holding in key the MD5 of the unpacked input string and in value its detected 3-letter language code ''seconds'':: time taken to execute this command on server ---- === Implementations === There are currently no available sample implementations. ---- === Changelog === Version 1: created this function ---- === Examples === ==== Input ==== {{{ #!xml DetectLanguage gi6jqoote1ofl5fafu8657mfr1 eNpLyUstVshKVUjMSVXILnpYnFepkJL6CQBfNwj/ ... more gzipped and then base64-encoded strings go here (if any) ... }}} ==== Output ==== {{{ #!xml status 200 OK data dfaffb9aa53bc5e9694fd962b9968b7e cze ... more language detect results go here (if any) ... seconds 0.425 }}} ---- === Notes === * if you get a descriptive language name instead of the 3-letter language code please contact us with input/output parameters (for example scots) * more info about language detection can be found at [http://www.boxoffice.ch/pseudo/ Statistical Text Analysis] ---- === See also === * [wiki:XmlRpcGetSubLanguages GetSubLanguages] ---- === Comments === add your comments, hints and suggestions here if you like ... -------- [Prev] [wiki:XmlRpcIntro Home] [Next]