root tools SignPuddle 3 Tools API https://signpuddle.com/server line > v3.0.0 group tools Resources related to tools line + Source: [ApiTxt format](../src/tools.txt) and [JSON objects](../src/tools.json) line + Documents: [API Blueprint](../doc/tools.md) and [Stand Alone HTML](../doc/tools.htm) line + Live Page: [API Interface](../api/tools.html) and [JavaScript](../api/tools.js) route /tools/ tools index method GET Get the tools index response 200 text/plain body Available routes: body body /tools/ body /tools/test{?text} body /tools/define body /tools/define/{section} body /tools/define/{section}/{part} body /tools/parse{?text,utf} body /tools/encode{?text,slash} body /tools/decode{?text} body /tools/utf8{?text} route /tools/define Character definition tree line The definition tree for character mapping method GET Get main define code $define = SignWriting\define(); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo json_pretty($define); response 200 text/plain;charset=utf-8 body { body "utf-8": {}, body "utf-16": {}, body "utf-32": {}, body "fsw": {}, body "swu": {}, body "style": {} body } route /tools/define/{section} Section definition line A section of the definition tree parameter section fsw string The name of section method GET Get section define code global $regex_define; code if ($section == "regex"){ code return $regex_define(); code } code global $sample_define; code if ($section == "sample"){ code return $sample_define(); code } code $define = SignWriting\define($section); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo json_pretty($define); response 200 text/plain;charset=utf-8 body { body "sign": [], body "spatial": [], body "symbol": [], body "coord": [], body "prefix": [], body "box": [], body "query": [] body } route /tools/define/{section}/{part} Part definition line A part of the section definition parameter section swu string The name of section parameter part symbol string The part of the definition method GET Get part define code $define = SignWriting\define($section,$part); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo json_pretty($define); response 200 text/plain;charset=utf-8 body [ body "individual symbol", body "S10000", body "[\\x{40000}-\\x{4F428}]" body ] route /tools/parse{?text,utf} Parse text line A function to analyze text and parse it into individual components parameter text S10000 string The text to parse parameter utf 32 string The UTF number of 8, 16, 32 or 'x' method GET Get parse results code if (!in_array($utf,[8,16,32,'x'])){ code $utf = 16; code } code $parse = SignWriting\parse($text); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code $json = json_pretty($parse); code echo SignWriting\cast($json,$utf); response 200 text/plain;charset=utf-8 body { body "fsw": { body "symbol": [ body "S10000" body ] body }, body "query": { body "base": [ body 100 body ], body "symbol": [ body "S10000" body ] body } body } route /tools/encode{?text,slash} Encode text line A function to encode SignWriting in Unicode (SWU) as UTF-16 parameter text 𝠀񆄱񈠣񍉡𝠃𝤛𝤵񍉡𝣴𝣵񆄱𝤌𝤆񈠣𝤉𝤚 string The text to encode parameter slash 1 number The number of slashes for escaping method GET Get encoded query string code $encode = SignWriting\encode($text,$slash); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo $encode; response 200 text/plain;charset=utf-8 body \uD836\uDC00\uD8D8\uDD31\uD8E2\uDC23\uD8F4\uDE61\uD836\uDC03\uD836\uDD1B\uD836\uDD35\uD8F4\uDE61\uD836\uDCF4\uD836\uDCF5\uD8D8\uDD31\uD836\uDD0C\uD836\uDD06\uD8E2\uDC23\uD836\uDD09\uD836\uDD1A route /tools/decode{?text} Decode text line A function to decode SignWriting in Unicode (SWU) from UTF-16 parameter text \\uD836\\uDC00 string The text to decode method GET Get decoded query string code $decode = SignWriting\decode($text); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo $decode; response 200 text/plain;charset=utf-8 body 𝠀 route /tools/utf8{?text} UTF-8 encode text parameter text 𝠀񆄱񈠣񍉡𝠃𝤛𝤵񍉡𝣴𝣵񆄱𝤌𝤆񈠣𝤉𝤚 string The text to encode method GET Get utf-8 encoded query string code $encode = SignWriting\utf8($text); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo $encode; response 200 text/plain;charset=utf-8 body %F0%9D%A0%80%F1%86%84%B1%F1%88%A0%A3%F1%8D%89%A1%F0%9D%A0%83%F0%9D%A4%9B%F0%9D%A4%B5%F1%8D%89%A1%F0%9D%A3%B4%F0%9D%A3%B5%F1%86%84%B1%F0%9D%A4%8C%F0%9D%A4%86%F1%88%A0%A3%F0%9D%A4%89%F0%9D%A4%9A route /tools/test{?text,opt1,opt2} Test with input line A general purpose function for testing parameter text S10000 string Input for testing parameter opt1 AS string Option one for testing parameter opt2 AS string Option two for testing method GET Get test results code $test = SignWriting\test($text,$opt1,$opt2); code $searchTime = searchtime($timein); code header("Search-Time: " . $searchTime); code echo $test; response 200 text/plain;charset=utf-8 body test output