root dictionary SignPuddle 3 Dictionary API https://signpuddle.com/server line ## Dictionary line line SignPuddle 3 organizes user dictionary elements into dictionary collections. line Dictionary collections are available in three different forms: database, plain text files, and JSON objects line line ### Databases line line Each collection is available as an SQLite database. line These databases are the primary source and all edits are directly applied to the database. line line table entry line + id line + sign line + terms line + lower line + signtext line + text line + source line + detail line + user line + created_at line + updated_at line line ### Plain Text Files line line Each collection is available as a plain text field where each entry occupies its own line. line Each entry contains multiple fields that are divided by tab characters. line The plain text files are designed for easy import and export from the databases. line line id /t sign /t terms /t lower /t signtext /t text /t source /t detail /t user /t updated_at line line ### JSON Data files line line The dictionary JSON data file is an object. line Each key contains an object with three properties: message, description, icon, and updated_at. line line { line "name": "xml-MY-dictionary-public", line "data": [ line { line "id": "2", line "sign": "\ud836\udc03\ud836\udd44\ud836\udd19\ud8ef\udfa1\ud836\udcf4\ud836\udcf4\ud8dd\udc54\ud836\udcc8\ud836\udcfc\ud8dd\udc42\ud836\udd26\ud836\udcfa\ud8c8\uddd2\ud836\udd15\ud836\udcee\ud8c8\uddda\ud836\udce0\ud836\udcef", line "terms": [ line "Malaysia" line ], line "lower": [ line "malaysia" line ], line "signtext": "", line "text": "", line "source": "Conference Maastricht", line "detail": {}, line "user": "admin", line "created_at": "2007-03-29T19:09:37Z", line "updated_at": "2007-03-29T19:09:37Z" line } line ] line } line group dictionary Resources related to dictionary collections line + Source: [ApiTxt format](../src/dictionary.txt) and [JSON objects](../src/dictionary.json) line + Documents: [API Blueprint](../doc/dictionary.md) and [Stand Alone HTML](../doc/dictionary.htm) line + Live Page: [API Dictionary](../api/dictionary.html) and [JavaScript](../api/dictionary.js) route /dictionary{?name} Dictionaries available parameter name public string partial dictionary name method GET Get available dictionaries code $dir = 'data/db/'; code $ext = '.db'; code $out = []; code if ($name){ code if (strpos($name,"dictionary")!==false){ code $dictionaries = $dir . '*' . $name . '*' . $ext; code $files = glob($dictionaries); code } else { code $dictionaries = $dir . '*dictionary*' . $name . '*' . $ext; code $files = glob($dictionaries); code if (count($files)==0) { code $dictionaries = $dir . '*' . $name . '*dictionary*' . $ext; code $files = glob($dictionaries); code } code } code } else { code $dictionaries = $dir . '*dictionary*' . $ext; code $files = glob($dictionaries); code } code foreach ($files as $filename) { code $out[] = str_replace($ext,'',str_replace($dir,'',$filename)); code } code if (count($out)){ code echo json_pretty($out); code } else { code $app->response->setStatus(204); code } code return; response 200 text/plain body ["ase-US-dictionary-public"] route /dictionary/{name}{?update} Dictionary resource Access to available dictionaries parameter name `ase-US-dictionary-public` required,string The name of an dictionary parameter update 1 optional,number Forces a rewrite of the dictionary for json and txt formats method GET retrieve dictionary code $headers = getHeaders(); code $pass = isset($headers['Pass'])?$headers['Pass']:''; code rightsCheck($name,$pass,SP_VIEW); code $check = isset($headers['If-Modified-Since'])?$headers['If-Modified-Since']:''; code if (strpos($name,'.')){ code $parts = explode('.',$name); code $name = $parts[0]; code $format = $parts[1]; code if (!in_array($format,['db','txt','json'])){ code haltNotFound(); code } code } else { code $format = 'json'; code } code $dir = 'data/' . $format . '/'; code $ext = '.' . $format; code $file = $dir . $name . $ext; code $err = invalidName($name); code if ($err){ code haltBadRequest($err); code } code $lastModified = lastModified($name); code if ($lastModified <= $check && !$update){ code haltNotModified(); code } code if ($format=='json' && (!file_exists($file) || $update)) { code $json = dictionary2json($name); code file_put_contents($file,$json); code } else if ($format=='txt' && (!file_exists($file) || $update)) { code $txt = dictionary2txt($name); code file_put_contents($file,$txt); code } code if(file_exists($file)) { code header('Last-Modified: ' . $lastModified); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code getFile($file); code } else { code haltNotFound(); code } request dictionary text header If-Modified-Since 2019-01-16T16:56:19.175Z response 200 text/plain body 1𝠀ρ‚±‘ρ‚‡™ρ†Ώƒπ ƒπ€π€”ρ‚‡™π£°π£Ήρ†Ώƒπ€Žπ€ρ‚±‘𝣽𝀀test zerotest zerowe are testing SignPuddle 1.6Val ;-){"video":"