From 786c2cc26ce64cc67f333b6da2ccf288650b3608 Mon Sep 17 00:00:00 2001 From: Pedro Augusto Date: Sat, 12 Mar 2022 11:43:03 -0300 Subject: [PATCH] prepare for next version --- webapp/public/grammar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/public/grammar.json b/webapp/public/grammar.json index b8bd5b0..7913162 100644 --- a/webapp/public/grammar.json +++ b/webapp/public/grammar.json @@ -1 +1 @@ -{"normalizers":{"ordinalNumber":"function ordinalNumber(lang) {\r\n function OrdinalNumbers(last, tenFirstNumbers) {\r\n return (word, compareStr) => {\r\n if (compareStr(word, last)) return '-1'\r\n if (!Number.isNaN(parseInt(word, 10)))\r\n return parseInt(word, 10).toString()\r\n\r\n const i = tenFirstNumbers.findIndex((a) => compareStr(a, word))\r\n\r\n return i === -1 ? undefined : (i + 1).toString()\r\n }\r\n }\r\n\r\n if (lang === 'pt-BR')\r\n return OrdinalNumbers('último', [\r\n 'primeiro',\r\n 'segundo',\r\n 'terceiro',\r\n 'quarto',\r\n 'quinto',\r\n 'sexto',\r\n 'sétimo',\r\n 'oitavo',\r\n 'nono',\r\n 'décimo',\r\n ])\r\n\r\n return OrdinalNumbers('last', [\r\n 'first',\r\n 'second',\r\n 'third',\r\n 'fourth',\r\n 'fifth',\r\n 'sixth',\r\n 'seventh',\r\n 'eighth',\r\n 'ninth',\r\n 'tenth',\r\n ])\r\n }","boolean":"function boolean(lang) {\r\n return function(word, compareStr) {\r\n return word != undefined ? true : false\r\n }\r\n }","identity":"function identity(lang) {\r\n return function(word, compareStr) {\r\n return word\r\n }\r\n }","number":"function number(lang) {\r\n return function(word, compareStr) {\r\n const numbers = {\r\n 'pt-BR': ['zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez'],\r\n 'en-US': ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']\r\n }\r\n\r\n if (!isNaN(parseInt(word))) return parseInt(word).toString()\r\n\r\n const val = numbers[lang].indexOf(word)\r\n\r\n if (val !== -1) return val.toString()\r\n\r\n // for some reason this is valid #42\r\n // FUCKIN HELL\r\n if (/^(#\\d+)$/.test(word)) return word.substr(1)\r\n\r\n return undefined\r\n }\r\n }","elementarMathOperation":"function elementarMathOperation(lang) {\r\n const enUS = [['plus', '+'], ['times', '*'], ['minus', '-'], ['divided', '/']];\r\n const ptBR = [['mais', '+'], ['vezes', '*'], ['menos', '-'], ['dividido', '/']];\r\n const langs = {\r\n 'en-US': enUS,\r\n 'pt-BR': ptBR\r\n };\r\n return (word, compareStr) => {\r\n const op = langs[lang].find(([name]) => compareStr(name, word)) || [];\r\n return op[1];\r\n };\r\n }"},"templates":{"{any}":{"value":"(.*)","examples":{"pt-BR":["quem é você","isto é um teste"],"en-US":["who are you","the universe is cracked"]}},"{term}":{"value":"^(?![\\* ]$).*","examples":{"pt-BR":["valor","lista","yellow","dog","andar","a"],"en-US":["value","graph","number","text","temp","a"]}},"{ordinalNumber}":{"value":"(\\S+)","examples":{"pt-BR":["1ª","42ª","último","primeiro","sétimo"],"en-US":["1ª","42ª","last","first","fourth"]}},"{numeral}":{"value":"(\\d+)","examples":{"pt-BR":["1","42"],"en-US":["1","42"]}},"{number}":{"value":"^(?![\\* ]$).*","examples":{"pt-BR":["1","2","three","four","five","six","42","21","19"],"en-US":["1","2","três","quatro","cinco","seis","42","21","19"]},"defaultNormalizer":"number"},"{char}":{"value":"(.)","examples":{"pt-BR":["a","B","A","z"],"en-US":["g","K","M"]}},"@anything":{"value":"","examples":{"pt-BR":["gap"],"en-US":["gap"]}}},"stopWords":{"en-US":{"words":["a -> P1 != (letter|symbol|word)","the","with","you","can","please","from -> S != (to)","to -> S != (from)","of","it","its","it's","is","are","was","were","in"],"expressions":[]},"pt-BR":{"words":["a -> P1 != (letra|símbolo|palavra)","o -> P1 != (letra|símbolo|palavra)","ao","você","com","pode","na","do -> S != (até)","de -> S != (até)","da -> S != (até)","dos","das","as","os","para -> S != (todo)","é","era","estava","como","uma","vá"],"expressions":["por favor"]}},"modules":[{"id":"typescript","grammar":{"en-US":[{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(conditional)"}},{"v":"1","w":"2","value":{"label":"(statement)"}},{"v":"2","w":"3","value":{"label":"(if)"}},{"v":"3","w":"4","value":{"label":"(else)","store":"otherwise","normalizer":"boolean"}},{"v":"2","w":"5","value":{"label":"([expressions])","store":"condition"}},{"v":"3","w":"5","value":{"label":"([expressions])","store":"condition"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"condition"}}],"value":{"id":"condition","label":"Condition Statement","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Creates a if/else statement","desc":"Creates a if/else statement with the provided expression as condition","examples":"\r\n conditional statement,\r\n conditional statement [expressions],\r\n conditional statement if [expressions],\r\n conditional statement if else [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Condition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Condition.\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let { condition = anything, otherwise = false } = command;\r\n condition = typeof condition === 'string' ? condition : condition === null || condition === void 0 ? void 0 : condition.value;\r\n let text = `if(${condition}) {\\n\\n}${otherwise ? ' else {\\n\\n}' : ''}`;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (condition.includes(anything)) {\r\n const pos = await editor.findPositionOf(anything);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nexports.default = Condition;\r\n","phrases":["conditional statement","conditional statement expression number 35 plus number 89 plus text what is happening peter text","conditional statement if false","conditional statement if else gap"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"},"parent":"sg61"},{"v":"8","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"doublecircle"}},{"v":"13","value":{"shape":"circle"}},{"v":"sg61","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(cursor, pointer)"}},{"v":"1","w":"2","value":{"label":"(line)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"line"}},{"v":"1","w":"5","value":{"label":"(symbol, letter)"}},{"v":"7","w":"5","value":{"label":"(symbol, letter)"}},{"v":"1","w":"7","value":{"label":"({ordinalNumber})","store":"leapSize","normalizer":"ordinalNumber"}},{"v":"5","w":"6","value":{"label":"({char})","store":"symbol"}},{"v":"1","w":"8","value":{"label":"(begin, end)","store":"linePosition"}},{"v":"8","w":"10","value":{"label":"(line)","sem":"of"}},{"v":"1","w":"11","value":{"label":"(next)"}},{"v":"11","w":"13","value":{"label":"({number})","store":"leapSize"}},{"v":"11","w":"12","value":{"label":"(symbols, symbols)"}},{"v":"13","w":"12","value":{"label":"(symbols, symbols)"}}],"value":{"id":"cursor","label":"Move cursor","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Move cursor","desc":"Moves the cursor to a different line or token","examples":"\r\n pointer line 21,\r\n pointer line 44,\r\n cursor line 23,\r\n pointer end of line,\r\n pointer begin of line,\r\n pointer first letter A,\r\n pointer next five symbols\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function cursor(args, editor, context) {\r\n console.log('[Spoken]: Executing: \"cursor.\"');\r\n if (args.linePosition != null) {\r\n const pos = args.linePosition === LinePostionEnum.BEGIN ? 'BEGIN_LINE' : 'END_LINE';\r\n return await editor.moveCursorTo(pos);\r\n }\r\n else if (args.line) {\r\n return await editor.goToLine(args.line);\r\n }\r\n else if (!args.symbol) {\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo(null, undefined, nth);\r\n }\r\n else {\r\n if (args.leapSize == undefined)\r\n args.leapSize = '1';\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo('SYMBOL', args.symbol, nth);\r\n }\r\n return await editor.moveCursorTo('BEGIN_LINE');\r\n}\r\nvar LinePostionEnum;\r\n(function (LinePostionEnum) {\r\n LinePostionEnum[LinePostionEnum[\"BEGIN\"] = 0] = \"BEGIN\";\r\n LinePostionEnum[LinePostionEnum[\"END\"] = 1] = \"END\";\r\n})(LinePostionEnum || (LinePostionEnum = {}));\r\nexports.default = cursor;\r\n","phrases":["pointer line 21","pointer line 44","cursor line 23","pointer end of line","pointer begin of line","pointer first letter A","pointer next five symbols"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(expression)"}},{"v":"1","w":"2","value":{"label":"([expressions])","store":"left"}},{"v":"2","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"4","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"right"}}],"value":{"id":"elementar_math_op","label":"Elementar Math Operation","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Writes a elementar math operation","desc":"Writes a elementar math operation (*, -, +, /)","examples":"\r\n expression number 35 [math_operator] number 89 [math_operator] [string],\r\n expression [variable_reference] [math_operator] [variable_reference],\r\n expression [variable_reference] [logical_operator] [variable_reference],\r\n expression [variable_reference] [math_operator] [function_call] [logical_operator] number 42\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteElementarMathOperation(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteElementarMathOperation\"');\r\n let operation = toArray(command.operation);\r\n let right = toArray(command.right);\r\n let text = toValue(command.left);\r\n for (let i = 0; i < right.length; i++) {\r\n if (operation[i].isNegative) {\r\n if (operation[i].operator === '===')\r\n text += ' !== ' + toValue(right[i]);\r\n else\r\n text = '!(' + text + ' ' + operation[i].operator + ' ' + toValue(right[i]) + ')';\r\n }\r\n else {\r\n text += ' ' + operation[i].operator + ' ' + toValue(right[i]);\r\n }\r\n }\r\n if (command.parent)\r\n return text;\r\n await editor.write(text);\r\n const wildcard = [command.left, ...right].find(item => typeof item !== 'string');\r\n if (wildcard) {\r\n const pos = await editor.findPositionOf(wildcard.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = WriteElementarMathOperation;\r\n","phrases":["expression number 35 plus number 89 plus text what is happening peter text","expression reference namespace bike module reference constant bike","expression constant age negative equals reference variable horse","expression constant called quote is null quote minus execute function normalize on true with 2 arguments less or equals than number 42"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"([number], [string], [variable_reference], [elementar_math_op], [function_call])","store":"expression"}},{"v":"0","w":"2","value":{"label":"(gap)","store":"wildCard","normalizer":"identity"}},{"v":"0","w":"3","value":{"label":"(false, true)","store":"booleanConstants"}}],"value":{"id":"expressions","label":"Writes a expression","lang":"en-US","langName":"English","pad":"0.2","nodesep":"1","ranksep":"2","rankdir":"LR","alias":"true","title":"Writes a expression","desc":"Writes a expression in the editor, this is meant to be used inside another automatas","examples":"\r\n false,\r\n true,\r\n gap,\r\n [number],\r\n [string],\r\n [variable_reference],\r\n [elementar_math_op],\r\n [function_call]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Expression(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Expression\"');\r\n let { expression, parent, wildCard, booleanConstants } = command;\r\n // really ??? (fix later)\r\n if (booleanConstants != null)\r\n expression = booleanConstants == 1 ? 'true' : 'false';\r\n if (parent) {\r\n return expression ? expression : { value: wildCard, isWildCard: true };\r\n }\r\n return await editor.write(expression || wildCard);\r\n}\r\nexports.default = Expression;\r\n","phrases":["false","true","gap","number 14","text what is happening peter text","constant name","expression number 35 plus number 89 plus text what is happening peter text","execute function remove on number 14"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(call, execute)"}},{"v":"1","w":"2","value":{"label":"(function)"}},{"v":"2","w":"3","value":{"label":"([multi_word_token])","store":"functionName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"3","w":"4","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"({term})","store":"functionName"}},{"v":"4","w":"11","value":{"label":"(of, on, at)","disableSpellcheck":"true"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"11","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"4","w":"6","value":{"label":"(arguments)","sem":"with"}},{"v":"5","w":"6","value":{"label":"(arguments)","sem":"with"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"7","w":"8","value":{"label":"(and)"}},{"v":"8","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"4","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"with"}},{"v":"5","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"with"}},{"v":"9","w":"10","value":{"label":"(arguments)"}}],"value":{"id":"function_call","label":"Calls a function","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","priority":"2","title":"Calls a function","desc":"Calls a function with the specified arguments in the desired caller","examples":"\r\n call function test,\r\n execute function normalize on [expressions] with 2 arguments,\r\n execute function remove on [expressions] with arguments [expressions] and [expressions],\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionCall(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionCall\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n const functionName = join(command.functionName);\r\n const argsNumber = command.argsNumber ? parseInt(command.argsNumber, 10) : command.oneArg ? 1 : NaN;\r\n const args = command.args ? toArray(command.args) : [];\r\n const caller = command.caller ? toValue(command.caller) : null;\r\n let text = functionName + '(';\r\n if (argsNumber) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n else if (args.length) {\r\n text += (args.map(item => typeof item === 'string' ? item : anything).join(', '));\r\n }\r\n text += ')';\r\n if (caller)\r\n text = caller + '.' + text;\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nconst join = (item) => typeof item === 'string' ? item : item.join('');\r\nexports.default = FunctionCall;\r\n","phrases":["call function test","execute function normalize on true with 2 arguments","execute function remove on number 14 with arguments number 14 and execute function remove on number 14"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(new, create, declare)"}},{"v":"1","w":"2","value":{"label":"(function)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"fnName"}},{"v":"3","w":"4","value":{"label":"({number})","store":"argsNumber"}},{"v":"4","w":"5","value":{"label":"(arguments)"}},{"v":"3","w":"6","value":{"label":"(return, returning)"}},{"v":"5","w":"6","value":{"label":"(return, returning)"}},{"v":"0","w":"6","value":{"label":"(return)","store":"returnOnly"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"returnValue"}}],"value":{"id":"function_declaration","label":"Creates a function","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","priority":"2","title":"Creates a function","desc":"Creates a function with the desired number of args and return value","examples":"\r\n declare function multiply with [number] arguments,\r\n declare function multiply with 2 arguments return [expressions],\r\n declare function divide return [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionDeclaration(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionDeclaration\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n let { fnName, argsNumber, returnValue, returnOnly } = command;\r\n argsNumber = argsNumber != null ? parseInt(argsNumber, 10) : 0;\r\n let text = '';\r\n if (returnOnly == undefined) {\r\n text = `function ${fnName}(`;\r\n if (argsNumber > 0) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n text += ') {\\n';\r\n if (returnValue != null) {\r\n text += 'return ' + toValue(returnValue);\r\n }\r\n text += '\\n}';\r\n }\r\n else {\r\n text = 'return ' + toValue(returnValue);\r\n }\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n const r = await editor.goToLine(line._line + 1);\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return r;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = FunctionDeclaration;\r\n","phrases":["declare function multiply with number 14 arguments","declare function multiply with 2 arguments return constant name","declare function divide return number 14"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(go)"}},{"v":"1","w":"2","value":{"label":"(to)"}},{"v":"0","w":"3","value":{"label":"(line)"}},{"v":"1","w":"3","value":{"label":"(line)"}},{"v":"2","w":"3","value":{"label":"(line)"}},{"v":"3","w":"5","value":{"label":"(number)"}},{"v":"3","w":"4","value":{"label":"({number})","store":"line"}},{"v":"5","w":"4","value":{"label":"({number})","store":"line"}}],"value":{"id":"go_to_line","label":"Change line","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Change line","desc":"Moves the cursor to a different line","examples":"\r\n go to line [number],\r\n go to line number [number],\r\n line number [number],\r\n line [number]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function goToLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"goToLine.\"');\r\n return await editor.goToLine(command.line);\r\n}\r\nexports.default = goToLine;\r\n","phrases":["go to line number one","go to line number 18","line number number one","line number five"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg79"},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"circle"},"parent":"sg79"},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"sg79","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(and, or, equals, =)","store":"logicalOperator"}},{"v":"2","w":"1","value":{"label":"(and, or, equals, =)","store":"logicalOperator"}},{"v":"0","w":"2","value":{"label":"(not, negative)","store":"isNegative","normalizer":"boolean"}},{"v":"0","w":"3","value":{"label":"(less, greater)","store":"inequalityOperator"}},{"v":"2","w":"3","value":{"label":"(less, greater)","store":"inequalityOperator"}},{"v":"3","w":"4","value":{"label":"(or, λ)"}},{"v":"4","w":"5","value":{"label":"(equals, =)","store":"orEqual","normalizer":"boolean"}},{"v":"3","w":"7","value":{"label":"(than)"}},{"v":"5","w":"7","value":{"label":"(than)"}}],"value":{"id":"logical_operator","label":"Writes a logical operator","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","alias":"true","title":"Writes a logical operator","desc":"Writes a logical operator (===, !==, &&, ||, >, <, >=, <=) meant to be used inside expressions","examples":"\r\n and,\r\n or,\r\n equals,\r\n less than,\r\n greater than,\r\n less or equals than,\r\n greater or equals than,\r\n not equals,\r\n negative equals,\r\n negative and,\r\n negative or\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function LogicalOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"LogicalOperator\"');\r\n const { logicalOperator, isNegative = false, inequalityOperator, orEqual = false } = command;\r\n if (logicalOperator !== undefined) {\r\n const operator = ['&&', '||', '===', '==='][logicalOperator];\r\n return { operator, isNegative };\r\n }\r\n else if (inequalityOperator !== undefined) {\r\n const operator = ['<', '>'][inequalityOperator] + (orEqual ? '=' : '');\r\n return { operator, isNegative };\r\n }\r\n return { operator: 'error', isNegative: false };\r\n}\r\nexports.default = LogicalOperator;\r\n","phrases":["and","or","equals","less than","greater than","less or equals than","greater or equals than","not equals","negative equals","negative and","negative or"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(plus, times, minus, divided, module, +, x, -, /, %)","store":"mathOperator"}},{"v":"1","w":"1","value":{"label":"(by)"}}],"value":{"id":"math_operator","label":"Writes a math operator","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","alias":"true","title":"Writes a math operator","desc":"Writes a math operator (*, -, +, /, %) meant to be used inside expressions","examples":"\r\n plus,\r\n times,\r\n minus,\r\n divided by,\r\n module\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MathOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"MathOperator\"');\r\n const { mathOperator } = command;\r\n const operator = ['+', '*', '-', '/', '%'][mathOperator % 5] || 'error';\r\n return { operator };\r\n}\r\n// @ts-ignore\r\nexports.default = MathOperator;\r\n","phrases":["plus","times","minus","divided by","module"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"3","value":{"label":"(*)"}},{"v":"3","w":"3","value":{"label":"({any})","store":"words"}},{"v":"3","w":"4","value":{"label":"(*)"}}],"value":{"id":"multi_word_token","label":"Group multiple words together","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","disableStopWords":"true","title":"Group multiple words together","desc":"Group multiple words together in one variable meant to be used as alias in other commands","examples":"\r\n quote blue car quote,\r\n quote multi word token quote,\r\n quote to upper case quote,\r\n quote to string quote,\r\n quote to integer quote,\r\n quote is null quote,\r\n quote has next quote,\r\n quote is full quote,\r\n quote camel case quote,\r\n quote get string could quote,\r\n quote get color quote,\r\n quote really good function quote,\r\n quote U S A quote,\r\n quote W H O quote,\r\n quote F A T O S quote\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MultiWordTokens(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"MultiWordTokens\"');\r\n function camelCase(words) {\r\n return words.map((a, i) => i ? a.charAt(0).toUpperCase() + a.slice(1) : a);\r\n }\r\n if (((_a = command.extra) === null || _a === void 0 ? void 0 : _a.case) === 'camel') {\r\n return camelCase(command.words);\r\n }\r\n return command.words;\r\n}\r\nexports.default = MultiWordTokens;\r\n","phrases":["quote blue car quote","quote multi word token quote","quote to upper case quote","quote to string quote","quote to integer quote","quote is null quote","quote has next quote","quote is full quote","quote camel case quote","quote get string could quote","quote get color quote","quote really good function quote","quote U S A quote","quote W H O quote","quote F A T O S quote"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg84"},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"},"parent":"sg86"},{"v":"5","value":{"shape":"circle"},"parent":"sg84"},{"v":"sg84","value":{"shape":"circle"}},{"v":"sg86","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(new)"}},{"v":"5","w":"1","value":{"label":"(new)"}},{"v":"1","w":"2","value":{"label":"(line)"}},{"v":"5","w":"2","value":{"label":"(line)"}},{"v":"2","w":"3","value":{"label":"(above, below)","store":"position"}},{"v":"4","w":"3","value":{"label":"(above, below)","store":"position"}},{"v":"0","w":"4","value":{"label":"(line)"}},{"v":"0","w":"5","value":{"label":"(create)"}},{"v":"5","w":"5","value":{"label":"(a)"}}],"value":{"id":"new_line","label":"New line","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"New line","desc":"Creates a new line above or below the current line","examples":"\r\n create line,\r\n create a line,\r\n create line above,\r\n create line below\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function newLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"new line.\"');\r\n return await editor.newLine(command.position);\r\n}\r\nexports.default = newLine;\r\n","phrases":["create line","create a line","create line above","create line below"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(number)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"number"}},{"v":"0","w":"3","value":{"label":"({number})","store":"number"}}],"value":{"id":"number","label":"Writes a number","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","priority":"2","title":"Writes a number","desc":"Writes a number in the editor","examples":"\r\n number one,\r\n number four,\r\n number five,\r\n number 43,\r\n number 14,\r\n number 140,\r\n 140,\r\n 123,\r\n 42,\r\n 18\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteNumber(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteNumber\"');\r\n const { number, parent } = command;\r\n if (parent)\r\n return number;\r\n return await editor.write(number);\r\n}\r\nexports.default = WriteNumber;\r\n","phrases":["number one","number four","number five","number 43","number 14","number 140","140","123","42","18"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(remove)"}},{"v":"1","w":"2","value":{"label":"(line)","store":"isLine","normalizer":"boolean"}},{"v":"1","w":"3","value":{"label":"(selection)","store":"isSelection","normalizer":"boolean"}}],"value":{"id":"remove_ln_sec","label":"Remove","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Remove","desc":"Removes the current line or the current selection","examples":"\r\n remove line,\r\n remove selection\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function remove(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"remove line/selection.\"');\r\n if (command.isLine) {\r\n const line = await editor.getLine();\r\n if (line instanceof Error)\r\n throw line;\r\n return await editor.remove(line.lineNumber);\r\n }\r\n else {\r\n return await editor.write('');\r\n }\r\n}\r\nexports.default = remove;\r\n","phrases":["remove line","remove selection"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"doublecircle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"circle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"}},{"v":"13","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(repetition)"}},{"v":"1","w":"2","value":{"label":"(statement)"}},{"v":"2","w":"9","value":{"label":"(for)"}},{"v":"9","w":"10","value":{"label":"(every)"}},{"v":"10","w":"11","value":{"label":"({term})","store":"item"}},{"v":"11","w":"12","value":{"label":"(of, λ)"}},{"v":"12","w":"13","value":{"label":"([expressions])","store":"collection"}},{"v":"2","w":"3","value":{"label":"(from)"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"from"}},{"v":"4","w":"5","value":{"label":"(to)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"to"}},{"v":"6","w":"7","value":{"label":"(step)"}},{"v":"7","w":"8","value":{"label":"([expressions])","store":"step"}}],"value":{"id":"repetition","label":"Repetition Statement","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Creates a for loop statement","desc":"Creates a for loop statement with the provided expressions as parameters","examples":"\r\n repetition statement from [number] to [number],\r\n repetition statement from [number] to [number] step expression variable i plus number 5,\r\n repetition statement for every car of constant cars,\r\n repetition statement for every animal of earth,\r\n repetition statement for every prime of variable primes,\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Repetition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Repetition.\"');\r\n const gap = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n if (command.from == undefined && command.item == undefined) {\r\n text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n }\r\n else if (command.from != null && command.to != null) {\r\n const from = toValue(command.from);\r\n const to = toValue(command.to);\r\n const step = command.step ? toValue(command.step) : 'i + 1';\r\n text = `for(let i = ${from}; i < ${to}; i = ${step}) {\\n\\n}`;\r\n }\r\n else if (command.item != null && command.collection != null) {\r\n const item = command.item;\r\n const collection = toValue(command.collection);\r\n text = `for(const ${item} of ${collection}) {\\n\\n}`;\r\n }\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (command.collection && text.includes(gap)) {\r\n const pos = await editor.findPositionOf(gap);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = Repetition;\r\n","phrases":["repetition statement from number 14 to 123","repetition statement from 140 to number 140 step expression variable i plus number 5","repetition statement for every car of constant cars","repetition statement for every animal of earth","repetition statement for every prime of variable primes"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(run)"}},{"v":"1","w":"2","value":{"label":"(current, this)"}},{"v":"2","w":"3","value":{"label":"(file)"}}],"value":{"id":"run","label":"Run file","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Run current file","desc":"Run the current file in the terminal using node","examples":"\r\n run current file,\r\n run this file\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function run(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"run.\"');\r\n const info = await editor.fileInfo();\r\n return await editor.writeOnTerminal('node \"' + info.fileName + '\"');\r\n}\r\nexports.default = run;\r\n","phrases":["run current file","run this file"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"},"parent":"sg94"},{"v":"13","value":{"shape":"circle"}},{"v":"14","value":{"shape":"circle"}},{"v":"15","value":{"shape":"circle"}},{"v":"16","value":{"shape":"circle"}},{"v":"17","value":{"shape":"doublecircle"}},{"v":"18","value":{"shape":"circle"},"parent":"sg90"},{"v":"19","value":{"shape":"circle"}},{"v":"20","value":{"shape":"doublecircle"}},{"v":"sg90","value":{"shape":"circle"}},{"v":"sg94","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(select)"}},{"v":"1","w":"2","value":{"label":"(letter, symbol)"}},{"v":"18","w":"2","value":{"label":"(letter, symbol)"}},{"v":"2","w":"3","value":{"label":"({char})","store":"word"}},{"v":"1","w":"4","value":{"label":"(word)"}},{"v":"18","w":"4","value":{"label":"(word)"}},{"v":"4","w":"20","value":{"label":"([multi_word_token])","store":"word","extraArgs":"{\"case\": \"camel\"}"}},{"v":"4","w":"3","value":{"label":"({term})","store":"word"}},{"v":"1","w":"5","value":{"label":"(from)"}},{"v":"1","w":"18","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"wordPosition"}},{"v":"5","w":"13","value":{"label":"(line)","store":"selectLine"}},{"v":"13","w":"19","value":{"label":"(number)"}},{"v":"13","w":"14","value":{"label":"({number})","store":"from"}},{"v":"19","w":"14","value":{"label":"({number})","store":"from"}},{"v":"14","w":"15","value":{"label":"(to)"}},{"v":"15","w":"16","value":{"label":"(line, λ)"}},{"v":"16","w":"17","value":{"label":"({number})","store":"to"}},{"v":"5","w":"11","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"fromPosition"}},{"v":"5","w":"6","value":{"label":"(letter, symbol)"}},{"v":"11","w":"6","value":{"label":"(letter, symbol)"}},{"v":"6","w":"7","value":{"label":"({char})","store":"from"}},{"v":"7","w":"8","value":{"label":"(to)"}},{"v":"8","w":"9","value":{"label":"(letter, symbol, λ)"}},{"v":"12","w":"9","value":{"label":"(letter, symbol, λ)"}},{"v":"8","w":"12","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"toPosition"}},{"v":"9","w":"10","value":{"label":"({char})","store":"to"}}],"value":{"id":"select","label":"Select","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Select","desc":"Select a piece of the text in the current line","examples":"\r\n select the letter B,\r\n select the symbol 5,\r\n select the letter Q,\r\n select the first letter B,\r\n select the second letter K,\r\n select the last workd this,\r\n select the word ball,\r\n select the word [multi_word_token],\r\n select from line 2 to line 15,\r\n select from line number 45 to line 90,\r\n select from letter A to letter Z,\r\n select from second leter G to last letter P\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Select(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"select\"');\r\n command.word = Array.isArray(command.word) ? command.word.join('') : command.word;\r\n if (command.selectLine != undefined) {\r\n return await editor.select(parseInt(command.from, 10), parseInt(command.to, 10), true);\r\n }\r\n else if (command.word != undefined) {\r\n const occurences = await editor.findPositionOf(command.word);\r\n let wordPosition = parseInt(command.wordPosition, 10) || 1;\r\n if (wordPosition === -1)\r\n wordPosition = occurences.length;\r\n if (occurences.length) {\r\n return await editor.select(occurences[wordPosition - 1][0], occurences[wordPosition - 1][1] - 1, false);\r\n }\r\n throw new Error('Nothing found for string: ' + command.word);\r\n }\r\n const from = command.from || '';\r\n const to = command.to || '';\r\n let fromPos = parseInt(command.fromPosition, 10) || 1;\r\n let toPos = parseInt(command.toPosition, 10) || 1;\r\n if (from === '' || to === '') {\r\n throw new Error('Invalid arguments!');\r\n }\r\n const matchFrom = await editor.findPositionOf(from);\r\n if (fromPos === -1)\r\n fromPos = matchFrom.length;\r\n const pad = matchFrom[fromPos - 1][1] || 0;\r\n const matchTo = await editor.findPositionOf(to, undefined, pad);\r\n if (toPos === -1)\r\n toPos = matchTo.length;\r\n return await editor.select(matchFrom[fromPos - 1][0], pad + matchTo[toPos - 1][0], false);\r\n}\r\nexports.default = Select;\r\n","phrases":["select the letter B","select the symbol 5","select the letter Q","select the first letter B","select the second letter K","select the last workd this","select the word ball","select the word quote get color quote","select from line 2 to line 15","select from line number 45 to line 90","select from letter A to letter Z","select from second leter G to last letter P"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(string, text)"}},{"v":"2","w":"2","value":{"label":"({any})","store":"string"}},{"v":"2","w":"4","value":{"label":"(string, text)"}}],"value":{"id":"string","label":"Writes a string","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Writes a string","desc":"Writes a string in the editor","examples":"\r\n string hello world string,\r\n string null pointer exeception is bad string,\r\n text this can be any piece of writing text,\r\n string hello my name is giovani girogio string,\r\n text what is happening peter text,\r\n text H E L L O text,\r\n string O N U string,\r\n string U S A string\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteString(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteString\"');\r\n command.string = Array.isArray(command.string) ? command.string : [command.string];\r\n const text = '\"' + command.string.join(' ') + '\"';\r\n if (command.parent)\r\n return text;\r\n return await editor.write(text);\r\n}\r\nexports.default = WriteString;\r\n","phrases":["string hello world string","string null pointer exeception is bad string","text this can be any piece of writing text","string hello my name is giovani girogio string","text what is happening peter text","text H E L L O text","string O N U string","string U S A string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(undo, redo)","store":"task"}},{"v":"1","w":"2","value":{"label":"(that)"}},{"v":"1","w":"3","value":{"label":"(last)"}},{"v":"3","w":"4","value":{"label":"(operation, command)"}},{"v":"2","w":"5","value":{"label":"(again)"}},{"v":"4","w":"5","value":{"label":"(again)"}}],"value":{"id":"undo_redo","label":"Undo or redo the last command","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Undo or redo the last operation/command","desc":"Undo or redo the last operation, used to correct mistakes. Just like CTRL + (Z | Y).","examples":"\r\n undo that,\r\n undo that again,\r\n redo the last operation,\r\n undo the last operation again\r\n redo that\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function undoRedo(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Undo/Redo.\"');\r\n const task = command.task;\r\n if (task === 0)\r\n return await editor.undo();\r\n else\r\n return await editor.redo();\r\n}\r\nexports.default = undoRedo;\r\n","phrases":["undo that","undo that again","redo the last operation","undo the last operation again","redo that"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(new, declare, create)","store":"isNew","normalizer":"boolean"}},{"v":"0","w":"2","value":{"label":"(variable, constant)","store":"memType"}},{"v":"1","w":"2","value":{"label":"(variable, constant)","store":"memType"}},{"v":"2","w":"3","value":{"label":"(called, named)"}},{"v":"3","w":"4","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"2","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"3","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"(equals, =)"}},{"v":"7","w":"5","value":{"label":"(equals, =)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"expression"}}],"value":{"id":"variable_assignment","label":"Stores a value in a variable","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Stores a value in a variable","desc":"Stores a number, string etc in a variable","examples":"\r\n new variable value equals [expressions],\r\n variable called batch equals [expressions],\r\n declare variable called [multi_word_token] equals [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function NewVariable(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"NewVariable\"');\r\n let { isNew, varName, expression, memType } = command;\r\n const value = typeof expression === 'string' ? expression : expression === null || expression === void 0 ? void 0 : expression.value;\r\n const allocate = memType === 0 ? 'let ' : 'const ';\r\n varName = Array.isArray(varName) ? varName.join('') : varName;\r\n const text = `${isNew ? allocate : ''}${varName}${value ? ` = ${value}` : ''}`;\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (typeof expression !== 'string' && (expression === null || expression === void 0 ? void 0 : expression.value) != null) {\r\n const pos = await editor.findPositionOf(expression.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nexports.default = NewVariable;\r\n","phrases":["new variable value equals expression number 35 plus number 89 plus text what is happening peter text","variable called batch equals expression number 35 plus number 89 plus text what is happening peter text","declare variable called quote camel case quote equals execute function remove on number 14"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(reference)"}},{"v":"0","w":"2","value":{"label":"(variable, constant)"}},{"v":"1","w":"2","value":{"label":"(variable, constant)"}},{"v":"0","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"1","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"6","w":"2","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"(called)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}}],"value":{"id":"variable_reference","label":"References a variable","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"References a variable","desc":"Writes a variable or constant in the editor","examples":"\r\n variable value,\r\n variable label,\r\n constant name,\r\n constant age,\r\n constant language,\r\n namespace color,\r\n reference variable horse,\r\n reference constant bike,\r\n reference namespace bike,\r\n namespace called [multi_word_token],\r\n constant called [multi_word_token],\r\n variable called [multi_word_token],\r\n reference variable called [multi_word_token],\r\n reference constant called [multi_word_token]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function VariableReference(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"VariableReference\"');\r\n let { varName, parent, isNamespace = false } = command;\r\n varName = Array.isArray(varName) ? varName : [varName];\r\n varName = isNamespace ? varName.map(a => a[0].toUpperCase() + a.substr(1)).join('') : varName.join('');\r\n if (parent)\r\n return varName;\r\n return await editor.write(varName);\r\n}\r\nexports.default = VariableReference;\r\n","phrases":["variable value","variable label","constant name","constant age","constant language","namespace color","reference variable horse","reference constant bike","reference namespace bike","namespace called quote is null quote","constant called quote is null quote","variable called quote get string could quote","reference variable called quote to string quote","reference constant called quote has next quote"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"},"parent":"sg114"},{"v":"10","value":{"shape":"doublecircle"}},{"v":"sg114","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(print)"}},{"v":"0","w":"2","value":{"label":"(write)"}},{"v":"2","w":"1","value":{"label":"(down, λ)"}},{"v":"2","w":"3","value":{"label":"(it)"}},{"v":"3","w":"1","value":{"label":"(down, λ)"}},{"v":"1","w":"4","value":{"label":"(space)","store":"isSpace","normalizer":"boolean"}},{"v":"1","w":"5","value":{"label":"({any})","store":"text"}},{"v":"5","w":"5","value":{"label":"({any})","store":"text"}},{"v":"1","w":"6","value":{"label":"(letter)","store":"isDitaction","normalizer":"boolean"}},{"v":"6","w":"7","value":{"label":"({char})","store":"text"}},{"v":"9","w":"7","value":{"label":"({char})","store":"text"}},{"v":"7","w":"8","value":{"label":"(and)"}},{"v":"8","w":"9","value":{"label":"(letter)"}},{"v":"1","w":"10","value":{"label":"(dot)","store":"isDot","normalizer":"boolean"}}],"value":{"id":"write","label":"Write text","lang":"en-US","langName":"English","pad":"0.2","disableStopWords":"true","rankdir":"LR","title":"Write text","desc":"Write some text in the editor","examples":"\r\n write hello how are you friend,\r\n print my name is Giovani,\r\n print it down how are you mate,\r\n write letter B and letter E and letter T\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function write(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"write.\"');\r\n let text = null;\r\n if (command.isSpace)\r\n text = ' ';\r\n else if (command.isDot)\r\n text = '.';\r\n else\r\n text = Array.isArray(command.text) ? (_a = command.text) === null || _a === void 0 ? void 0 : _a.join(command.isDitaction ? '' : ' ') : command.text;\r\n return await editor.write(text);\r\n}\r\nexports.default = write;\r\n","phrases":["write hello how are you friend","print my name is Giovani","print it down how are you mate","write letter B and letter E and letter T"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(change, switch)"}},{"v":"1","w":"2","value":{"label":"(language)"}},{"v":"2","w":"3","value":{"label":"(back)"}},{"v":"2","w":"4","value":{"label":"(portuguese)","sem":"to"}},{"v":"3","w":"4","value":{"label":"(portuguese)","sem":"to"}}],"value":{"id":"__change_lang","label":"Change input language","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Change input language","desc":"Changes input language to portuguese","examples":"\r\n change language to portuguese,\r\n switch language to portuguese,\r\n switch language to english,\r\n switch language back to french\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function changeLang(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"changeLang.\"');\r\n console.log('This is an internal command this file should never run!');\r\n return null;\r\n}\r\nexports.default = changeLang;\r\n","phrases":["change language to portuguese","switch language to portuguese","switch language to english","switch language back to french"]}}],"pt-BR":[{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(estrutura)"}},{"v":"1","w":"2","value":{"label":"(condicional)"}},{"v":"2","w":"3","value":{"label":"(se)","disableSpellcheck":"true"}},{"v":"2","w":"7","value":{"label":"([expressions])","store":"condition"}},{"v":"3","w":"7","value":{"label":"([expressions])","store":"condition"}},{"v":"3","w":"6","value":{"label":"(se)","disableSpellcheck":"true"}},{"v":"6","w":"4","value":{"label":"(não)","store":"otherwise","normalizer":"boolean","disableSpellcheck":"true"}},{"v":"3","w":"4","value":{"label":"(senão, sinal)","store":"otherwise","normalizer":"boolean","disableSpellcheck":"true"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"condition"}}],"value":{"id":"condition","label":"Estrutura condicional","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Estrutura condicional","desc":"Cria uma estrutura condicional if/else","examples":"\r\n estrutura condicional,\r\n estrutura condicional [expressions],\r\n estrutura condicional se [expressions],\r\n estrutura condicional se senão [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Condition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Condition.\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let { condition = anything, otherwise = false } = command;\r\n condition = typeof condition === 'string' ? condition : condition === null || condition === void 0 ? void 0 : condition.value;\r\n let text = `if(${condition}) {\\n\\n}${otherwise ? ' else {\\n\\n}' : ''}`;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (condition.includes(anything)) {\r\n const pos = await editor.findPositionOf(anything);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nexports.default = Condition;\r\n","phrases":["estrutura condicional","estrutura condicional referêncie variável chamada aspas A B C D aspas","estrutura condicional se verdadeiro","estrutura condicional se senão texto B R T texto"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"},"parent":"sg63"},{"v":"8","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"doublecircle"}},{"v":"13","value":{"shape":"circle"}},{"v":"sg63","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(cursor, ponteiro)"}},{"v":"1","w":"2","value":{"label":"(linha)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"line"}},{"v":"1","w":"5","value":{"label":"(símbolo, letra)"}},{"v":"7","w":"5","value":{"label":"(símbolo, letra)"}},{"v":"1","w":"7","value":{"label":"({ordinalNumber})","store":"leapSize","normalizer":"ordinalNumber"}},{"v":"5","w":"6","value":{"label":"({char})","store":"symbol"}},{"v":"1","w":"8","value":{"label":"(começo, final)","store":"linePosition"}},{"v":"8","w":"10","value":{"label":"(linha)","sem":"da"}},{"v":"1","w":"11","value":{"label":"(próximo)"}},{"v":"11","w":"13","value":{"label":"({number})","store":"leapSize"}},{"v":"11","w":"12","value":{"label":"(símbolo, letra)"}},{"v":"13","w":"12","value":{"label":"(símbolo, letra)"}}],"value":{"id":"cursor","label":"Mover o cursor","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Mover o cursor","desc":"Move o cursor para uma linha ou símbolo","examples":"\r\n ponteiro linha 21,\r\n ponteiro linha 44,\r\n cursor linha 23,\r\n ponteiro final da linha,\r\n ponteiro começo da linha,\r\n ponteiro primeira letra A,\r\n ponteiro próximos 5 símbolos\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function cursor(args, editor, context) {\r\n console.log('[Spoken]: Executing: \"cursor.\"');\r\n if (args.linePosition != null) {\r\n const pos = args.linePosition === LinePostionEnum.BEGIN ? 'BEGIN_LINE' : 'END_LINE';\r\n return await editor.moveCursorTo(pos);\r\n }\r\n else if (args.line) {\r\n return await editor.goToLine(args.line);\r\n }\r\n else if (!args.symbol) {\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo(null, undefined, nth);\r\n }\r\n else {\r\n if (args.leapSize == undefined)\r\n args.leapSize = '1';\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo('SYMBOL', args.symbol, nth);\r\n }\r\n return await editor.moveCursorTo('BEGIN_LINE');\r\n}\r\nvar LinePostionEnum;\r\n(function (LinePostionEnum) {\r\n LinePostionEnum[LinePostionEnum[\"BEGIN\"] = 0] = \"BEGIN\";\r\n LinePostionEnum[LinePostionEnum[\"END\"] = 1] = \"END\";\r\n})(LinePostionEnum || (LinePostionEnum = {}));\r\nexports.default = cursor;\r\n","phrases":["ponteiro linha 21","ponteiro linha 44","cursor linha 23","ponteiro final da linha","ponteiro começo da linha","ponteiro primeira letra A","ponteiro próximos 5 símbolos"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(expressão)"}},{"v":"1","w":"2","value":{"label":"([expressions])","store":"left"}},{"v":"2","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"4","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"right"}}],"value":{"id":"elementar_math_op","label":"Operação Matemática Elementar","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Escreve uma operação matemática elementar","desc":"Escreve uma operação matemática elementar (*, -, +, /)","examples":"\r\n expressão [expressions] [math_operator] [expressions],\r\n expressão [expressions] [logical_operator] [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteElementarMathOperation(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteElementarMathOperation\"');\r\n let operation = toArray(command.operation);\r\n let right = toArray(command.right);\r\n let text = toValue(command.left);\r\n for (let i = 0; i < right.length; i++) {\r\n if (operation[i].isNegative) {\r\n if (operation[i].operator === '===')\r\n text += ' !== ' + toValue(right[i]);\r\n else\r\n text = '!(' + text + ' ' + operation[i].operator + ' ' + toValue(right[i]) + ')';\r\n }\r\n else {\r\n text += ' ' + operation[i].operator + ' ' + toValue(right[i]);\r\n }\r\n }\r\n if (command.parent)\r\n return text;\r\n await editor.write(text);\r\n const wildcard = [command.left, ...right].find(item => typeof item !== 'string');\r\n if (wildcard) {\r\n const pos = await editor.findPositionOf(wildcard.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = WriteElementarMathOperation;\r\n","phrases":["expressão referêncie variável chamada aspas A B C D aspas módulo verdadeiro","expressão verdadeiro não e gap"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"([number], [string], [variable_reference], [elementar_math_op], [function_call])","store":"expression"}},{"v":"0","w":"2","value":{"label":"(gap)","store":"wildCard","normalizer":"identity"}},{"v":"0","w":"3","value":{"label":"(falso, verdadeiro)","store":"booleanConstants"}}],"value":{"id":"expressions","label":"Escreve uma expressão","lang":"pt-BR","langName":"Português","pad":"0.2","nodesep":"1","ranksep":"2","rankdir":"LR","alias":"true","title":"Escreve uma expressão","desc":"Escreve uma expressão no editor de texto, esse automata foi projetado para ser usado em outros automatas","examples":"\r\n falso,\r\n verdadeiro,\r\n gap,\r\n [number],\r\n [string],\r\n [variable_reference],\r\n [elementar_math_op],\r\n [function_call]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Expression(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Expression\"');\r\n let { expression, parent, wildCard, booleanConstants } = command;\r\n // really ??? (fix later)\r\n if (booleanConstants != null)\r\n expression = booleanConstants == 1 ? 'true' : 'false';\r\n if (parent) {\r\n return expression ? expression : { value: wildCard, isWildCard: true };\r\n }\r\n return await editor.write(expression || wildCard);\r\n}\r\nexports.default = Expression;\r\n","phrases":["falso","verdadeiro","gap","número cinco","texto B R T texto","referêncie variável chamada aspas A B C D aspas","expressão gap","execute a função normalizar no texto B R T texto com 2 argumentos"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(chame, chamar, execute)"}},{"v":"1","w":"2","value":{"label":"(função)","sem":"a"}},{"v":"2","w":"3","value":{"label":"([multi_word_token])","store":"functionName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"3","w":"4","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"({term})","store":"functionName"}},{"v":"4","w":"11","value":{"label":"(da, na, do, no)"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"11","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"4","w":"6","value":{"label":"(argumentos)","sem":"com"}},{"v":"5","w":"6","value":{"label":"(argumentos)","sem":"com"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"7","w":"8","value":{"label":"(e)"}},{"v":"8","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"4","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"com"}},{"v":"5","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"com"}},{"v":"9","w":"10","value":{"label":"(argumentos)"}}],"value":{"id":"function_call","label":"Chama uma função","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","priority":"2","title":"Chama uma função","desc":"Chama uma função com os determinados argumentos no determinado caller","examples":"\r\n execute a função teste,\r\n execute a função normalizar no [expressions] com 2 argumentos,\r\n execute a função remover no [expressions] com os argumentos [expressions] e [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionCall(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionCall\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n const functionName = join(command.functionName);\r\n const argsNumber = command.argsNumber ? parseInt(command.argsNumber, 10) : command.oneArg ? 1 : NaN;\r\n const args = command.args ? toArray(command.args) : [];\r\n const caller = command.caller ? toValue(command.caller) : null;\r\n let text = functionName + '(';\r\n if (argsNumber) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n else if (args.length) {\r\n text += (args.map(item => typeof item === 'string' ? item : anything).join(', '));\r\n }\r\n text += ')';\r\n if (caller)\r\n text = caller + '.' + text;\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nconst join = (item) => typeof item === 'string' ? item : item.join('');\r\nexports.default = FunctionCall;\r\n","phrases":["execute a função teste","execute a função normalizar no texto B R T texto com 2 argumentos","execute a função remover no texto B R T texto com os argumentos texto B R T texto e expressão gap"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(nova, declare, crie)"}},{"v":"1","w":"2","value":{"label":"(função)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"fnName"}},{"v":"3","w":"4","value":{"label":"({number})","store":"argsNumber"}},{"v":"4","w":"5","value":{"label":"(argumentos)"}},{"v":"3","w":"6","value":{"label":"(retorna, retornando)"}},{"v":"5","w":"6","value":{"label":"(retorna, retornando)"}},{"v":"0","w":"6","value":{"label":"(retorne)","store":"returnOnly"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"returnValue"}}],"value":{"id":"function_declaration","label":"Cria uma função","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","priority":"2","title":"Cria uma função","desc":"Cria uma função com o número de argumentos especificados e um valor de retorno","examples":"\r\n nova função multiplicar com [number] argumentos,\r\n nova função multiplicar com 2 argumentos retorna [expressions],\r\n declare a função dividir retornando [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionDeclaration(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionDeclaration\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n let { fnName, argsNumber, returnValue, returnOnly } = command;\r\n argsNumber = argsNumber != null ? parseInt(argsNumber, 10) : 0;\r\n let text = '';\r\n if (returnOnly == undefined) {\r\n text = `function ${fnName}(`;\r\n if (argsNumber > 0) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n text += ') {\\n';\r\n if (returnValue != null) {\r\n text += 'return ' + toValue(returnValue);\r\n }\r\n text += '\\n}';\r\n }\r\n else {\r\n text = 'return ' + toValue(returnValue);\r\n }\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n const r = await editor.goToLine(line._line + 1);\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return r;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = FunctionDeclaration;\r\n","phrases":["nova função multiplicar com número dois argumentos","nova função multiplicar com 2 argumentos retorna texto B R T texto","declare a função dividir retornando referêncie variável chamada aspas A B C D aspas"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(vá, vai)"}},{"v":"1","w":"2","value":{"label":"(para)"}},{"v":"2","w":"5","value":{"label":"(a)"}},{"v":"0","w":"3","value":{"label":"(linha)"}},{"v":"1","w":"3","value":{"label":"(linha)"}},{"v":"2","w":"3","value":{"label":"(linha)"}},{"v":"5","w":"3","value":{"label":"(linha)"}},{"v":"3","w":"6","value":{"label":"(número)"}},{"v":"3","w":"4","value":{"label":"({number})","store":"line"}},{"v":"6","w":"4","value":{"label":"({number})","store":"line"}}],"value":{"id":"go_to_line","label":"Trocar linha","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Trocar linha","desc":"Move or cursor para uma linha diferente","examples":"\r\n linha [number],\r\n vá para a linha [number],\r\n linha número [number],\r\n linha [number]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function goToLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"goToLine.\"');\r\n return await editor.goToLine(command.line);\r\n}\r\nexports.default = goToLine;\r\n","phrases":["linha número 140","vá para a linha número dois","linha número número cinco","linha número 140"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg82"},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"circle"},"parent":"sg82"},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"sg82","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(e, ou, igual, =)","store":"logicalOperator"}},{"v":"2","w":"1","value":{"label":"(e, ou, igual, =)","store":"logicalOperator"}},{"v":"0","w":"2","value":{"label":"(não, negativo)","store":"isNegative","normalizer":"boolean"}},{"v":"0","w":"3","value":{"label":"(menor, maior)","store":"inequalityOperator","disableSpellcheck":"true"}},{"v":"2","w":"3","value":{"label":"(menor, maior)","store":"inequalityOperator","disableSpellcheck":"true"}},{"v":"3","w":"4","value":{"label":"(ou)"}},{"v":"4","w":"5","value":{"label":"(igual, =)","store":"orEqual","normalizer":"boolean"}},{"v":"3","w":"7","value":{"label":"(que)"}},{"v":"5","w":"7","value":{"label":"(a)"}}],"value":{"id":"logical_operator","label":"Escreve um operador lógico","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","alias":"true","title":"Escreve um operador lógico","desc":"Escreve um operador lógico (===, !==, &&, ||, >, <, >=, <=) pensando para ser usado com expressões","examples":"\r\n e,\r\n ou,\r\n igual,\r\n menor que,\r\n maior que,\r\n menor ou igual a,\r\n maior ou igual a,\r\n não igual,\r\n negativo igual,\r\n não e,\r\n não ou\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function LogicalOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"LogicalOperator\"');\r\n const { logicalOperator, isNegative = false, inequalityOperator, orEqual = false } = command;\r\n if (logicalOperator !== undefined) {\r\n const operator = ['&&', '||', '===', '==='][logicalOperator];\r\n return { operator, isNegative };\r\n }\r\n else if (inequalityOperator !== undefined) {\r\n const operator = ['<', '>'][inequalityOperator] + (orEqual ? '=' : '');\r\n return { operator, isNegative };\r\n }\r\n return { operator: 'error', isNegative: false };\r\n}\r\nexports.default = LogicalOperator;\r\n","phrases":["e","ou","igual","menor que","maior que","menor ou igual a","maior ou igual a","não igual","negativo igual","não e","não ou"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(mais, vezes, menos, dividido, módulo, +, x, -, /, %)","store":"mathOperator","disableSpellcheck":"true"}},{"v":"1","w":"1","value":{"label":"(por)"}}],"value":{"id":"math_operator","label":"Escreve um operador matemático","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","alias":"true","title":"Escreve uma operador matemático","desc":"Escreve um operador matemático (*, -, +, /, '%') pensando para ser usado com expressões","examples":"\r\n mais,\r\n vezes,\r\n menos,\r\n dividido por,\r\n módulo\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MathOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"MathOperator\"');\r\n const { mathOperator } = command;\r\n const operator = ['+', '*', '-', '/', '%'][mathOperator % 5] || 'error';\r\n return { operator };\r\n}\r\n// @ts-ignore\r\nexports.default = MathOperator;\r\n","phrases":["mais","vezes","menos","dividido por","módulo"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"3","value":{"label":"(*)"}},{"v":"3","w":"3","value":{"label":"({any})","store":"words"}},{"v":"3","w":"4","value":{"label":"(*)"}}],"value":{"id":"multi_word_token","label":"Agrupa múltiplas palavras","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","title":"Agrupa múltiplas palavras","desc":"Agrupa múltiplas palavras juntas, projetado para ser usado dentro de outros automatas","examples":"\r\n aspas carro azul aspas,\r\n aspas nome composto de múltiplas palavras aspas,\r\n aspas frase parseada aspas,\r\n aspas transação crédito texto aspas,\r\n aspas preço total aspas,\r\n aspas preço por item aspas,\r\n aspas W H O aspas,\r\n aspas N U L L aspas,\r\n aspas A B C D aspas,\r\n aspas camel case aspas,\r\n * hola me nombre es felipe *\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MultiWordTokens(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"MultiWordTokens\"');\r\n function camelCase(words) {\r\n return words.map((a, i) => i ? a.charAt(0).toUpperCase() + a.slice(1) : a);\r\n }\r\n if (((_a = command.extra) === null || _a === void 0 ? void 0 : _a.case) === 'camel') {\r\n return camelCase(command.words);\r\n }\r\n return command.words;\r\n}\r\nexports.default = MultiWordTokens;\r\n","phrases":["aspas carro azul aspas","aspas nome composto de múltiplas palavras aspas","aspas frase parseada aspas","aspas transação crédito texto aspas","aspas preço total aspas","aspas preço por item aspas","aspas W H O aspas","aspas N U L L aspas","aspas A B C D aspas","aspas camel case aspas","* hola me nombre es felipe *"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg87"},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"},"parent":"sg89"},{"v":"5","value":{"shape":"circle"},"parent":"sg87"},{"v":"sg87","value":{"shape":"circle"}},{"v":"sg89","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(nova)"}},{"v":"5","w":"1","value":{"label":"(nova)"}},{"v":"1","w":"2","value":{"label":"(linha)"}},{"v":"5","w":"2","value":{"label":"(linha)"}},{"v":"2","w":"3","value":{"label":"(acima, abaixo)","store":"position"}},{"v":"4","w":"3","value":{"label":"(acima, abaixo)","store":"position"}},{"v":"0","w":"4","value":{"label":"(linha)"}},{"v":"0","w":"5","value":{"label":"(crie)"}},{"v":"5","w":"5","value":{"label":"(uma)"}},{"v":"4","w":"2","value":{"label":"(nova)"}}],"value":{"id":"new_line","label":"Linha nova","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Linha nova","desc":"Cria uma linha nova abaixo ou acima da linha atual","examples":"\r\n criar linha,\r\n nova linha,\r\n nova linha acima,\r\n nova linha abaixo\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function newLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"new line.\"');\r\n return await editor.newLine(command.position);\r\n}\r\nexports.default = newLine;\r\n","phrases":["criar linha","nova linha","nova linha acima","nova linha abaixo"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(número)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"number"}}],"value":{"id":"number","label":"Escreve um número","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","priority":"2","title":"Escreve um número","desc":"Escreve um número no editor","examples":"\r\n número dois,\r\n número quatro,\r\n número cinco,\r\n número 43,\r\n número 14,\r\n número 140\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteNumber(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteNumber\"');\r\n const { number, parent } = command;\r\n if (parent)\r\n return number;\r\n return await editor.write(number);\r\n}\r\nexports.default = WriteNumber;\r\n","phrases":["número dois","número quatro","número cinco","número 43","número 14","número 140"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(remover, remova, remove)"}},{"v":"1","w":"2","value":{"label":"(linha)","store":"isLine","normalizer":"boolean"}},{"v":"1","w":"3","value":{"label":"(seleção)","store":"isSelection","normalizer":"boolean"}}],"value":{"id":"remove_ln_sec","label":"Remover","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Remover","desc":"Remove a linha atual ou a seleção","examples":"\r\n remover linha,\r\n remova linha,\r\n remover seleção\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function remove(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"remove line/selection.\"');\r\n if (command.isLine) {\r\n const line = await editor.getLine();\r\n if (line instanceof Error)\r\n throw line;\r\n return await editor.remove(line.lineNumber);\r\n }\r\n else {\r\n return await editor.write('');\r\n }\r\n}\r\nexports.default = remove;\r\n","phrases":["remover linha","remova linha","remover seleção"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"doublecircle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"circle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"}},{"v":"13","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(estrutura)"}},{"v":"1","w":"1","value":{"label":"(de)"}},{"v":"1","w":"2","value":{"label":"(repetição)"}},{"v":"2","w":"9","value":{"label":"(para)"}},{"v":"9","w":"10","value":{"label":"(todo)"}},{"v":"10","w":"11","value":{"label":"({term})","store":"item"}},{"v":"11","w":"12","value":{"label":"(de, da, do, em, λ)"}},{"v":"12","w":"13","value":{"label":"([expressions])","store":"collection"}},{"v":"2","w":"3","value":{"label":"(de, da, do, λ)"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"from"}},{"v":"4","w":"5","value":{"label":"(até)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"to"}},{"v":"6","w":"7","value":{"label":"(etapa)"}},{"v":"7","w":"8","value":{"label":"([expressions])","store":"step"}}],"value":{"id":"repetition","label":"Estrutura de repetição","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Estrutura de repetição","desc":"Cria uma estrutura de repetição for","examples":"\r\n estrutura de repetição do [number] até [number],\r\n estrutura de repetição do [number] até [number] etapa expressão variável i mais número 5,\r\n estrutura de repetição para todo carro em constante carros,\r\n estrutura de repetição para todo animal na terra,\r\n estrutura de repetição para todo primo na variável primos,\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Repetition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Repetition.\"');\r\n const gap = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n if (command.from == undefined && command.item == undefined) {\r\n text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n }\r\n else if (command.from != null && command.to != null) {\r\n const from = toValue(command.from);\r\n const to = toValue(command.to);\r\n const step = command.step ? toValue(command.step) : 'i + 1';\r\n text = `for(let i = ${from}; i < ${to}; i = ${step}) {\\n\\n}`;\r\n }\r\n else if (command.item != null && command.collection != null) {\r\n const item = command.item;\r\n const collection = toValue(command.collection);\r\n text = `for(const ${item} of ${collection}) {\\n\\n}`;\r\n }\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (command.collection && text.includes(gap)) {\r\n const pos = await editor.findPositionOf(gap);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = Repetition;\r\n","phrases":["estrutura de repetição do número 140 até número 43","estrutura de repetição do número 14 até número 43 etapa expressão variável i mais número 5","estrutura de repetição para todo carro em constante carros","estrutura de repetição para todo animal na terra","estrutura de repetição para todo primo na variável primos"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(execute, executar)"}},{"v":"1","w":"4","value":{"label":"(este)"}},{"v":"4","w":"3","value":{"label":"(arquivo)"}},{"v":"1","w":"2","value":{"label":"(arquivo)"}},{"v":"2","w":"3","value":{"label":"(atual)"}}],"value":{"id":"run","label":"Executar arquivo","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Executar arquivo","desc":"Executa o arquivo atual no terminal usando node","examples":"\r\n executar este arquivo,\r\n executar arquivo atual\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function run(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"run.\"');\r\n const info = await editor.fileInfo();\r\n return await editor.writeOnTerminal('node \"' + info.fileName + '\"');\r\n}\r\nexports.default = run;\r\n","phrases":["executar este arquivo","executar arquivo atual"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"},"parent":"sg99"},{"v":"13","value":{"shape":"circle"}},{"v":"14","value":{"shape":"circle"}},{"v":"15","value":{"shape":"circle"}},{"v":"16","value":{"shape":"circle"}},{"v":"17","value":{"shape":"doublecircle"}},{"v":"18","value":{"shape":"circle"},"parent":"sg95"},{"v":"19","value":{"shape":"circle"}},{"v":"20","value":{"shape":"doublecircle"}},{"v":"sg95","value":{"shape":"circle"}},{"v":"sg99","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(selecione, selecionar)"}},{"v":"1","w":"2","value":{"label":"(letra, símbolo)"}},{"v":"18","w":"2","value":{"label":"(letra, símbolo)"}},{"v":"2","w":"3","value":{"label":"({char})","store":"word"}},{"v":"1","w":"4","value":{"label":"(palavra)"}},{"v":"18","w":"4","value":{"label":"(palavra)"}},{"v":"4","w":"20","value":{"label":"([multi_word_token])","store":"word","extraArgs":"{\"case\": \"camel\"}"}},{"v":"4","w":"3","value":{"label":"({term})","store":"word"}},{"v":"1","w":"5","value":{"label":"(de, da)"}},{"v":"1","w":"18","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"wordPosition"}},{"v":"5","w":"13","value":{"label":"(linha)","store":"selectLine"}},{"v":"13","w":"19","value":{"label":"(número)"}},{"v":"13","w":"14","value":{"label":"({number})","store":"from"}},{"v":"19","w":"14","value":{"label":"({number})","store":"from"}},{"v":"14","w":"15","value":{"label":"(até)"}},{"v":"15","w":"16","value":{"label":"(linha, λ)"}},{"v":"16","w":"17","value":{"label":"({number})","store":"to"}},{"v":"5","w":"11","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"fromPosition"}},{"v":"5","w":"6","value":{"label":"(letra, símbolo)"}},{"v":"11","w":"6","value":{"label":"(letra, símbolo)"}},{"v":"6","w":"7","value":{"label":"({char})","store":"from"}},{"v":"7","w":"8","value":{"label":"(até)"}},{"v":"8","w":"9","value":{"label":"(letra, símbolo, λ)"}},{"v":"12","w":"9","value":{"label":"(letra, símbolo, λ)"}},{"v":"8","w":"12","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"toPosition"}},{"v":"9","w":"10","value":{"label":"({char})","store":"to"}}],"value":{"id":"select","label":"Selecionar","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Selecionar","desc":"Seleciona um pedaço de texto na linha atual","examples":"\r\n selecione a letra B,\r\n selecione a símbolo 5,\r\n selecione a letra Q,\r\n selecione a primeira letra B,\r\n selecione a segunda letra K,\r\n selecione a última palavra valor,\r\n selecione a palavra lista,\r\n selecione a palavra [multi_word_token],\r\n selecione da linha 2 até a linha 15,\r\n selecione da linha número 45 até a linha 90,\r\n selecione da letra A até a letra Z,\r\n selecione da segunda letra G até a última letra P\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Select(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"select\"');\r\n command.word = Array.isArray(command.word) ? command.word.join('') : command.word;\r\n if (command.selectLine != undefined) {\r\n return await editor.select(parseInt(command.from, 10), parseInt(command.to, 10), true);\r\n }\r\n else if (command.word != undefined) {\r\n const occurences = await editor.findPositionOf(command.word);\r\n let wordPosition = parseInt(command.wordPosition, 10) || 1;\r\n if (wordPosition === -1)\r\n wordPosition = occurences.length;\r\n if (occurences.length) {\r\n return await editor.select(occurences[wordPosition - 1][0], occurences[wordPosition - 1][1] - 1, false);\r\n }\r\n throw new Error('Nothing found for string: ' + command.word);\r\n }\r\n const from = command.from || '';\r\n const to = command.to || '';\r\n let fromPos = parseInt(command.fromPosition, 10) || 1;\r\n let toPos = parseInt(command.toPosition, 10) || 1;\r\n if (from === '' || to === '') {\r\n throw new Error('Invalid arguments!');\r\n }\r\n const matchFrom = await editor.findPositionOf(from);\r\n if (fromPos === -1)\r\n fromPos = matchFrom.length;\r\n const pad = matchFrom[fromPos - 1][1] || 0;\r\n const matchTo = await editor.findPositionOf(to, undefined, pad);\r\n if (toPos === -1)\r\n toPos = matchTo.length;\r\n return await editor.select(matchFrom[fromPos - 1][0], pad + matchTo[toPos - 1][0], false);\r\n}\r\nexports.default = Select;\r\n","phrases":["selecione a letra B","selecione a símbolo 5","selecione a letra Q","selecione a primeira letra B","selecione a segunda letra K","selecione a última palavra valor","selecione a palavra lista","selecione a palavra * hola me nombre es felipe *","selecione da linha 2 até a linha 15","selecione da linha número 45 até a linha 90","selecione da letra A até a letra Z","selecione da segunda letra G até a última letra P"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(string, text)"}},{"v":"2","w":"2","value":{"label":"({any})","store":"string"}},{"v":"2","w":"4","value":{"label":"(string, text)"}}],"value":{"id":"string","label":"Escreve uma string","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Escreve uma string","desc":"Escreve uma string no editor","examples":"\r\n string olá mundo string,\r\n string erros de ponteiro nulos são ruims string,\r\n texto podemos dizer qualquer frase texto,\r\n string Olá meu nome é Giovani Giorgio string,\r\n texto e ele vai ligar pra todas até achar uma gata pra dar um passeio texto,\r\n texto U S A texto,\r\n texto B R T texto,\r\n string G R A S S string\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteString(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteString\"');\r\n command.string = Array.isArray(command.string) ? command.string : [command.string];\r\n const text = '\"' + command.string.join(' ') + '\"';\r\n if (command.parent)\r\n return text;\r\n return await editor.write(text);\r\n}\r\nexports.default = WriteString;\r\n","phrases":["string olá mundo string","string erros de ponteiro nulos são ruims string","texto podemos dizer qualquer frase texto","string Olá meu nome é Giovani Giorgio string","texto e ele vai ligar pra todas até achar uma gata pra dar um passeio texto","texto U S A texto","texto B R T texto","string G R A S S string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(desfazer, refazer)","store":"task"}},{"v":"0","w":"2","value":{"label":"(desfaça, refaça)","store":"task"}},{"v":"1","w":"3","value":{"label":"(isso)"}},{"v":"2","w":"3","value":{"label":"(isso)"}},{"v":"1","w":"4","value":{"label":"(último)"}},{"v":"2","w":"4","value":{"label":"(último)"}},{"v":"4","w":"5","value":{"label":"(comando, operação)"}},{"v":"3","w":"6","value":{"label":"(também)"}},{"v":"5","w":"6","value":{"label":"(também)"}}],"value":{"id":"undo_redo","label":"Desfaz ou refaz o último comando","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Refazer ou desfazer a última operação","desc":"Refazer ou desfazer a última operação, usado para corrgir erros.","examples":"\r\n desfaça isso,\r\n desfazer isto,\r\n desfaça a última operação,\r\n refaça isso,\r\n refazer a última operação\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function undoRedo(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Undo/Redo.\"');\r\n const task = command.task;\r\n if (task === 0)\r\n return await editor.undo();\r\n else\r\n return await editor.redo();\r\n}\r\nexports.default = undoRedo;\r\n","phrases":["desfaça isso","desfazer isto","desfaça a última operação","refaça isso","refazer a última operação"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(nova, declare, crie)","store":"isNew","normalizer":"boolean"}},{"v":"0","w":"2","value":{"label":"(variável, constante)","store":"memType"}},{"v":"1","w":"2","value":{"label":"(variável, constante)","store":"memType"}},{"v":"2","w":"3","value":{"label":"(chamada)"}},{"v":"3","w":"4","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"2","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"3","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"(igual, =)"}},{"v":"7","w":"5","value":{"label":"(igual, =)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"expression"}}],"value":{"id":"variable_assignment","label":"Guarda um valor em uma variável","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Guarda um valor em uma variável","desc":"Guarda um valor, inteiro, texto e etc em uma variável","examples":"\r\n nova variável valor igual a [expressions],\r\n variável valor igual a [expressions],\r\n nova variável chamada [multi_word_token] igual a [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function NewVariable(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"NewVariable\"');\r\n let { isNew, varName, expression, memType } = command;\r\n const value = typeof expression === 'string' ? expression : expression === null || expression === void 0 ? void 0 : expression.value;\r\n const allocate = memType === 0 ? 'let ' : 'const ';\r\n varName = Array.isArray(varName) ? varName.join('') : varName;\r\n const text = `${isNew ? allocate : ''}${varName}${value ? ` = ${value}` : ''}`;\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (typeof expression !== 'string' && (expression === null || expression === void 0 ? void 0 : expression.value) != null) {\r\n const pos = await editor.findPositionOf(expression.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nexports.default = NewVariable;\r\n","phrases":["nova variável valor igual a verdadeiro","variável valor igual a expressão gap","nova variável chamada aspas A B C D aspas igual a falso"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(referência, refira)"}},{"v":"0","w":"2","value":{"label":"(variável, constante)"}},{"v":"1","w":"2","value":{"label":"(variável, constante)"}},{"v":"0","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"1","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"6","w":"2","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"(chamada)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}}],"value":{"id":"variable_reference","label":"Referencia a uma variável","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Referencia a uma variável","desc":"Refere a uma variável ou constante já declarada","examples":"\r\n variável valor,\r\n variável descrição,\r\n constante name,\r\n constante idade,\r\n constante linguagem,\r\n namespace cor,\r\n referência variável cavalo,\r\n referência constante bicicleta,\r\n referência namespace bicicleta,\r\n namespace chamado [multi_word_token],\r\n constante chamada [multi_word_token],\r\n variável chamada [multi_word_token],\r\n referêncie variável chamada [multi_word_token],\r\n referêncie constante chamada [multi_word_token]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function VariableReference(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"VariableReference\"');\r\n let { varName, parent, isNamespace = false } = command;\r\n varName = Array.isArray(varName) ? varName : [varName];\r\n varName = isNamespace ? varName.map(a => a[0].toUpperCase() + a.substr(1)).join('') : varName.join('');\r\n if (parent)\r\n return varName;\r\n return await editor.write(varName);\r\n}\r\nexports.default = VariableReference;\r\n","phrases":["variável valor","variável descrição","constante name","constante idade","constante linguagem","namespace cor","referência variável cavalo","referência constante bicicleta","referência namespace bicicleta","namespace chamado aspas W H O aspas","constante chamada aspas W H O aspas","variável chamada aspas nome composto de múltiplas palavras aspas","referêncie variável chamada aspas A B C D aspas","referêncie constante chamada aspas carro azul aspas"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"},"parent":"sg115"},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"sg115","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(escreva)"}},{"v":"1","w":"3","value":{"label":"({any})","store":"text"}},{"v":"1","w":"2","value":{"label":"(espaço)","store":"isSpace","normalizer":"boolean"}},{"v":"3","w":"3","value":{"label":"({any})","store":"text"}},{"v":"1","w":"11","value":{"label":"(a)"}},{"v":"11","w":"6","value":{"label":"(letra)","store":"isDitaction","normalizer":"boolean"}},{"v":"6","w":"7","value":{"label":"({char})","store":"text"}},{"v":"9","w":"7","value":{"label":"({char})","store":"text"}},{"v":"7","w":"8","value":{"label":"(e, i)"}},{"v":"8","w":"9","value":{"label":"(letra)"}},{"v":"1","w":"10","value":{"label":"(ponto)","store":"isDot","normalizer":"boolean"}}],"value":{"id":"write","label":"Escrever texto","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","title":"Escrever texto","desc":"Escreve um pedaço de texto no editor de texto","examples":"\r\n escreva ola como vai você,\r\n escreva apenas um teste,\r\n escreva meu nome é giovani girogio,\r\n escreva letra a B e letra O e letra I\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function write(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"write.\"');\r\n let text = null;\r\n if (command.isSpace)\r\n text = ' ';\r\n else if (command.isDot)\r\n text = '.';\r\n else\r\n text = Array.isArray(command.text) ? (_a = command.text) === null || _a === void 0 ? void 0 : _a.join(command.isDitaction ? '' : ' ') : command.text;\r\n return await editor.write(text);\r\n}\r\nexports.default = write;\r\n","phrases":["escreva ola como vai você","escreva apenas um teste","escreva meu nome é giovani girogio","escreva letra a B e letra O e letra I"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(troque, trocar, mude, mudar)"}},{"v":"1","w":"2","value":{"label":"(linguagem)"}},{"v":"2","w":"4","value":{"label":"(inglês)","sem":"para"}}],"value":{"id":"__change_lang","label":"Mudar linguagem de entrada","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Mudar linguagem de entrada","desc":"Mudar linguagem de entrada para inglês","examples":"\r\n mude a linguagem para inglês,\r\n troque a linguagem para inglês,\r\n mudar linguagem para francês,\r\n trocar linguagem para inglês\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function changeLang(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"changeLang.\"');\r\n console.log('This is an internal command this file should never run!');\r\n return null;\r\n}\r\nexports.default = changeLang;\r\n","phrases":["mude a linguagem para inglês","troque a linguagem para inglês","mudar linguagem para francês","trocar linguagem para inglês"]}}]},"desc":"Collection of voice commands of the typescript language","label":"Typescript voice commands"}]} \ No newline at end of file +{"normalizers":{"ordinalNumber":"function ordinalNumber(lang) {\r\n function OrdinalNumbers(last, tenFirstNumbers) {\r\n return (word, compareStr) => {\r\n if (compareStr(word, last)) return '-1'\r\n if (!Number.isNaN(parseInt(word, 10)))\r\n return parseInt(word, 10).toString()\r\n\r\n const i = tenFirstNumbers.findIndex((a) => compareStr(a, word))\r\n\r\n return i === -1 ? undefined : (i + 1).toString()\r\n }\r\n }\r\n\r\n if (lang === 'pt-BR')\r\n return OrdinalNumbers('último', [\r\n 'primeiro',\r\n 'segundo',\r\n 'terceiro',\r\n 'quarto',\r\n 'quinto',\r\n 'sexto',\r\n 'sétimo',\r\n 'oitavo',\r\n 'nono',\r\n 'décimo',\r\n ])\r\n\r\n return OrdinalNumbers('last', [\r\n 'first',\r\n 'second',\r\n 'third',\r\n 'fourth',\r\n 'fifth',\r\n 'sixth',\r\n 'seventh',\r\n 'eighth',\r\n 'ninth',\r\n 'tenth',\r\n ])\r\n }","boolean":"function boolean(lang) {\r\n return function(word, compareStr) {\r\n return word != undefined ? true : false\r\n }\r\n }","identity":"function identity(lang) {\r\n return function(word, compareStr) {\r\n return word\r\n }\r\n }","number":"function number(lang) {\r\n return function(word, compareStr) {\r\n const numbers = {\r\n 'pt-BR': ['zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez'],\r\n 'en-US': ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']\r\n }\r\n\r\n if (!isNaN(parseInt(word))) return parseInt(word).toString()\r\n\r\n const val = numbers[lang].indexOf(word)\r\n\r\n if (val !== -1) return val.toString()\r\n\r\n // for some reason this is valid #42\r\n // FUCKIN HELL\r\n if (/^(#\\d+)$/.test(word)) return word.substr(1)\r\n\r\n return undefined\r\n }\r\n }","elementarMathOperation":"function elementarMathOperation(lang) {\r\n const enUS = [['plus', '+'], ['times', '*'], ['minus', '-'], ['divided', '/']];\r\n const ptBR = [['mais', '+'], ['vezes', '*'], ['menos', '-'], ['dividido', '/']];\r\n const langs = {\r\n 'en-US': enUS,\r\n 'pt-BR': ptBR\r\n };\r\n return (word, compareStr) => {\r\n const op = langs[lang].find(([name]) => compareStr(name, word)) || [];\r\n return op[1];\r\n };\r\n }"},"templates":{"{any}":{"value":"(.*)","examples":{"pt-BR":["quem é você","isto é um teste"],"en-US":["who are you","the universe is cracked"]}},"{term}":{"value":"^(?![\\* ]$).*","examples":{"pt-BR":["valor","lista","yellow","dog","andar","a"],"en-US":["value","graph","number","text","temp","a"]}},"{ordinalNumber}":{"value":"(\\S+)","examples":{"pt-BR":["1ª","42ª","último","primeiro","sétimo"],"en-US":["1ª","42ª","last","first","fourth"]}},"{numeral}":{"value":"(\\d+)","examples":{"pt-BR":["1","42"],"en-US":["1","42"]}},"{number}":{"value":"^(?![\\* ]$).*","examples":{"pt-BR":["1","2","three","four","five","six","42","21","19"],"en-US":["1","2","três","quatro","cinco","seis","42","21","19"]},"defaultNormalizer":"number"},"{char}":{"value":"(.)","examples":{"pt-BR":["a","B","A","z"],"en-US":["g","K","M"]}},"@anything":{"value":"","examples":{"pt-BR":["gap"],"en-US":["gap"]}}},"stopWords":{"en-US":{"words":["a -> P1 != (letter|symbol|word)","the","with","you","can","please","from -> S != (to)","to -> S != (from)","of","it","its","it's","is","are","was","were","in"],"expressions":[]},"pt-BR":{"words":["a -> P1 != (letra|símbolo|palavra)","o -> P1 != (letra|símbolo|palavra)","ao","você","com","pode","na","do -> S != (até)","de -> S != (até)","da -> S != (até)","dos","das","as","os","para -> S != (todo)","é","era","estava","como","uma","vá"],"expressions":["por favor"]}},"modules":[{"id":"typescript","grammar":{"en-US":[{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(conditional)"}},{"v":"1","w":"2","value":{"label":"(statement)"}},{"v":"2","w":"3","value":{"label":"(if)"}},{"v":"3","w":"4","value":{"label":"(else)","store":"otherwise","normalizer":"boolean"}},{"v":"2","w":"5","value":{"label":"([expressions])","store":"condition"}},{"v":"3","w":"5","value":{"label":"([expressions])","store":"condition"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"condition"}}],"value":{"id":"condition","label":"Condition Statement","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Creates a if/else statement","desc":"Creates a if/else statement with the provided expression as condition","examples":"\r\n conditional statement,\r\n conditional statement [expressions],\r\n conditional statement if [expressions],\r\n conditional statement if else [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Condition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Condition.\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let { condition = anything, otherwise = false } = command;\r\n condition = typeof condition === 'string' ? condition : condition === null || condition === void 0 ? void 0 : condition.value;\r\n let text = `if(${condition}) {\\n\\n}${otherwise ? ' else {\\n\\n}' : ''}`;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (condition.includes(anything)) {\r\n const pos = await editor.findPositionOf(anything);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nexports.default = Condition;\r\n","phrases":["conditional statement","conditional statement false","conditional statement if constant age","conditional statement if else string hello my name is giovani girogio string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"},"parent":"sg61"},{"v":"8","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"doublecircle"}},{"v":"13","value":{"shape":"circle"}},{"v":"sg61","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(cursor, pointer)"}},{"v":"1","w":"2","value":{"label":"(line)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"line"}},{"v":"1","w":"5","value":{"label":"(symbol, letter)"}},{"v":"7","w":"5","value":{"label":"(symbol, letter)"}},{"v":"1","w":"7","value":{"label":"({ordinalNumber})","store":"leapSize","normalizer":"ordinalNumber"}},{"v":"5","w":"6","value":{"label":"({char})","store":"symbol"}},{"v":"1","w":"8","value":{"label":"(begin, end)","store":"linePosition"}},{"v":"8","w":"10","value":{"label":"(line)","sem":"of"}},{"v":"1","w":"11","value":{"label":"(next)"}},{"v":"11","w":"13","value":{"label":"({number})","store":"leapSize"}},{"v":"11","w":"12","value":{"label":"(symbols, symbols)"}},{"v":"13","w":"12","value":{"label":"(symbols, symbols)"}}],"value":{"id":"cursor","label":"Move cursor","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Move cursor","desc":"Moves the cursor to a different line or token","examples":"\r\n pointer line 21,\r\n pointer line 44,\r\n cursor line 23,\r\n pointer end of line,\r\n pointer begin of line,\r\n pointer first letter A,\r\n pointer next five symbols\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function cursor(args, editor, context) {\r\n console.log('[Spoken]: Executing: \"cursor.\"');\r\n if (args.linePosition != null) {\r\n const pos = args.linePosition === LinePostionEnum.BEGIN ? 'BEGIN_LINE' : 'END_LINE';\r\n return await editor.moveCursorTo(pos);\r\n }\r\n else if (args.line) {\r\n return await editor.goToLine(args.line);\r\n }\r\n else if (!args.symbol) {\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo(null, undefined, nth);\r\n }\r\n else {\r\n if (args.leapSize == undefined)\r\n args.leapSize = '1';\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo('SYMBOL', args.symbol, nth);\r\n }\r\n return await editor.moveCursorTo('BEGIN_LINE');\r\n}\r\nvar LinePostionEnum;\r\n(function (LinePostionEnum) {\r\n LinePostionEnum[LinePostionEnum[\"BEGIN\"] = 0] = \"BEGIN\";\r\n LinePostionEnum[LinePostionEnum[\"END\"] = 1] = \"END\";\r\n})(LinePostionEnum || (LinePostionEnum = {}));\r\nexports.default = cursor;\r\n","phrases":["pointer line 21","pointer line 44","cursor line 23","pointer end of line","pointer begin of line","pointer first letter A","pointer next five symbols"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(expression)"}},{"v":"1","w":"2","value":{"label":"([expressions])","store":"left"}},{"v":"2","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"4","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"right"}}],"value":{"id":"elementar_math_op","label":"Elementar Math Operation","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Writes a elementar math operation","desc":"Writes a elementar math operation (*, -, +, /)","examples":"\r\n expression number 35 [math_operator] number 89 [math_operator] [string],\r\n expression [variable_reference] [math_operator] [variable_reference],\r\n expression [variable_reference] [logical_operator] [variable_reference],\r\n expression [variable_reference] [math_operator] [function_call] [logical_operator] number 42\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteElementarMathOperation(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteElementarMathOperation\"');\r\n let operation = toArray(command.operation);\r\n let right = toArray(command.right);\r\n let text = toValue(command.left);\r\n for (let i = 0; i < right.length; i++) {\r\n if (operation[i].isNegative) {\r\n if (operation[i].operator === '===')\r\n text += ' !== ' + toValue(right[i]);\r\n else\r\n text = '!(' + text + ' ' + operation[i].operator + ' ' + toValue(right[i]) + ')';\r\n }\r\n else {\r\n text += ' ' + operation[i].operator + ' ' + toValue(right[i]);\r\n }\r\n }\r\n if (command.parent)\r\n return text;\r\n await editor.write(text);\r\n const wildcard = [command.left, ...right].find(item => typeof item !== 'string');\r\n if (wildcard) {\r\n const pos = await editor.findPositionOf(wildcard.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = WriteElementarMathOperation;\r\n","phrases":["expression number 35 minus number 89 plus string null pointer exeception is bad string","expression reference constant called quote U S A quote divided by reference variable horse","expression namespace color greater or equals than constant name","expression constant name minus execute function normalize on constant age with 2 arguments greater or equals than number 42"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"([number], [string], [variable_reference], [elementar_math_op], [function_call])","store":"expression"}},{"v":"0","w":"2","value":{"label":"(gap)","store":"wildCard","normalizer":"identity"}},{"v":"0","w":"3","value":{"label":"(false, true)","store":"booleanConstants"}}],"value":{"id":"expressions","label":"Writes a expression","lang":"en-US","langName":"English","pad":"0.2","nodesep":"1","ranksep":"2","rankdir":"LR","alias":"true","title":"Writes a expression","desc":"Writes a expression in the editor, this is meant to be used inside another automatas","examples":"\r\n false,\r\n true,\r\n gap,\r\n [number],\r\n [string],\r\n [variable_reference],\r\n [elementar_math_op],\r\n [function_call]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Expression(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Expression\"');\r\n let { expression, parent, wildCard, booleanConstants } = command;\r\n // really ??? (fix later)\r\n if (booleanConstants != null)\r\n expression = booleanConstants == 1 ? 'true' : 'false';\r\n if (parent) {\r\n return expression ? expression : { value: wildCard, isWildCard: true };\r\n }\r\n return await editor.write(expression || wildCard);\r\n}\r\nexports.default = Expression;\r\n","phrases":["false","true","gap","number 140","string hello my name is giovani girogio string","constant age","expression number 35 minus number 89 plus string null pointer exeception is bad string","execute function remove on number 140"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(call, execute)"}},{"v":"1","w":"2","value":{"label":"(function)"}},{"v":"2","w":"3","value":{"label":"([multi_word_token])","store":"functionName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"3","w":"4","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"({term})","store":"functionName"}},{"v":"4","w":"11","value":{"label":"(of, on, at)","disableSpellcheck":"true"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"11","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"4","w":"6","value":{"label":"(arguments)","sem":"with"}},{"v":"5","w":"6","value":{"label":"(arguments)","sem":"with"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"7","w":"8","value":{"label":"(and)"}},{"v":"8","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"4","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"with"}},{"v":"5","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"with"}},{"v":"9","w":"10","value":{"label":"(arguments)"}}],"value":{"id":"function_call","label":"Calls a function","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","priority":"2","title":"Calls a function","desc":"Calls a function with the specified arguments in the desired caller","examples":"\r\n call function test,\r\n execute function normalize on [expressions] with 2 arguments,\r\n execute function remove on [expressions] with arguments [expressions] and [expressions],\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionCall(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionCall\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n const functionName = join(command.functionName);\r\n const argsNumber = command.argsNumber ? parseInt(command.argsNumber, 10) : command.oneArg ? 1 : NaN;\r\n const args = command.args ? toArray(command.args) : [];\r\n const caller = command.caller ? toValue(command.caller) : null;\r\n let text = functionName + '(';\r\n if (argsNumber) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n else if (args.length) {\r\n text += (args.map(item => typeof item === 'string' ? item : anything).join(', '));\r\n }\r\n text += ')';\r\n if (caller)\r\n text = caller + '.' + text;\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nconst join = (item) => typeof item === 'string' ? item : item.join('');\r\nexports.default = FunctionCall;\r\n","phrases":["call function test","execute function normalize on constant age with 2 arguments","execute function remove on false with arguments true and string hello my name is giovani girogio string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(new, create, declare)"}},{"v":"1","w":"2","value":{"label":"(function)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"fnName"}},{"v":"3","w":"4","value":{"label":"({number})","store":"argsNumber"}},{"v":"4","w":"5","value":{"label":"(arguments)"}},{"v":"3","w":"6","value":{"label":"(return, returning)"}},{"v":"5","w":"6","value":{"label":"(return, returning)"}},{"v":"0","w":"6","value":{"label":"(return)","store":"returnOnly"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"returnValue"}}],"value":{"id":"function_declaration","label":"Creates a function","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","priority":"2","title":"Creates a function","desc":"Creates a function with the desired number of args and return value","examples":"\r\n declare function multiply with [number] arguments,\r\n declare function multiply with 2 arguments return [expressions],\r\n declare function divide return [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionDeclaration(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionDeclaration\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n let { fnName, argsNumber, returnValue, returnOnly } = command;\r\n argsNumber = argsNumber != null ? parseInt(argsNumber, 10) : 0;\r\n let text = '';\r\n if (returnOnly == undefined) {\r\n text = `function ${fnName}(`;\r\n if (argsNumber > 0) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n text += ') {\\n';\r\n if (returnValue != null) {\r\n text += 'return ' + toValue(returnValue);\r\n }\r\n text += '\\n}';\r\n }\r\n else {\r\n text = 'return ' + toValue(returnValue);\r\n }\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n const r = await editor.goToLine(line._line + 1);\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return r;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = FunctionDeclaration;\r\n","phrases":["declare function multiply with 140 arguments","declare function multiply with 2 arguments return execute function remove on number 140","declare function divide return execute function remove on number 140"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(go)"}},{"v":"1","w":"2","value":{"label":"(to)"}},{"v":"0","w":"3","value":{"label":"(line)"}},{"v":"1","w":"3","value":{"label":"(line)"}},{"v":"2","w":"3","value":{"label":"(line)"}},{"v":"3","w":"5","value":{"label":"(number)"}},{"v":"3","w":"4","value":{"label":"({number})","store":"line"}},{"v":"5","w":"4","value":{"label":"({number})","store":"line"}}],"value":{"id":"go_to_line","label":"Change line","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Change line","desc":"Moves the cursor to a different line","examples":"\r\n go to line [number],\r\n go to line number [number],\r\n line number [number],\r\n line [number]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function goToLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"goToLine.\"');\r\n return await editor.goToLine(command.line);\r\n}\r\nexports.default = goToLine;\r\n","phrases":["go to line number five","go to line number number one","line number 123","line 123"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg79"},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"circle"},"parent":"sg79"},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"sg79","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(and, or, equals, =)","store":"logicalOperator"}},{"v":"2","w":"1","value":{"label":"(and, or, equals, =)","store":"logicalOperator"}},{"v":"0","w":"2","value":{"label":"(not, negative)","store":"isNegative","normalizer":"boolean"}},{"v":"0","w":"3","value":{"label":"(less, greater)","store":"inequalityOperator"}},{"v":"2","w":"3","value":{"label":"(less, greater)","store":"inequalityOperator"}},{"v":"3","w":"4","value":{"label":"(or, λ)"}},{"v":"4","w":"5","value":{"label":"(equals, =)","store":"orEqual","normalizer":"boolean"}},{"v":"3","w":"7","value":{"label":"(than)"}},{"v":"5","w":"7","value":{"label":"(than)"}}],"value":{"id":"logical_operator","label":"Writes a logical operator","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","alias":"true","title":"Writes a logical operator","desc":"Writes a logical operator (===, !==, &&, ||, >, <, >=, <=) meant to be used inside expressions","examples":"\r\n and,\r\n or,\r\n equals,\r\n less than,\r\n greater than,\r\n less or equals than,\r\n greater or equals than,\r\n not equals,\r\n negative equals,\r\n negative and,\r\n negative or\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function LogicalOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"LogicalOperator\"');\r\n const { logicalOperator, isNegative = false, inequalityOperator, orEqual = false } = command;\r\n if (logicalOperator !== undefined) {\r\n const operator = ['&&', '||', '===', '==='][logicalOperator];\r\n return { operator, isNegative };\r\n }\r\n else if (inequalityOperator !== undefined) {\r\n const operator = ['<', '>'][inequalityOperator] + (orEqual ? '=' : '');\r\n return { operator, isNegative };\r\n }\r\n return { operator: 'error', isNegative: false };\r\n}\r\nexports.default = LogicalOperator;\r\n","phrases":["and","or","equals","less than","greater than","less or equals than","greater or equals than","not equals","negative equals","negative and","negative or"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(plus, times, minus, divided, module, +, x, -, /, %)","store":"mathOperator"}},{"v":"1","w":"1","value":{"label":"(by)"}}],"value":{"id":"math_operator","label":"Writes a math operator","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","alias":"true","title":"Writes a math operator","desc":"Writes a math operator (*, -, +, /, %) meant to be used inside expressions","examples":"\r\n plus,\r\n times,\r\n minus,\r\n divided by,\r\n module\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MathOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"MathOperator\"');\r\n const { mathOperator } = command;\r\n const operator = ['+', '*', '-', '/', '%'][mathOperator % 5] || 'error';\r\n return { operator };\r\n}\r\n// @ts-ignore\r\nexports.default = MathOperator;\r\n","phrases":["plus","times","minus","divided by","module"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"3","value":{"label":"(*)"}},{"v":"3","w":"3","value":{"label":"({any})","store":"words"}},{"v":"3","w":"4","value":{"label":"(*)"}}],"value":{"id":"multi_word_token","label":"Group multiple words together","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","disableStopWords":"true","title":"Group multiple words together","desc":"Group multiple words together in one variable meant to be used as alias in other commands","examples":"\r\n quote blue car quote,\r\n quote multi word token quote,\r\n quote to upper case quote,\r\n quote to string quote,\r\n quote to integer quote,\r\n quote is null quote,\r\n quote has next quote,\r\n quote is full quote,\r\n quote camel case quote,\r\n quote get string could quote,\r\n quote get color quote,\r\n quote really good function quote,\r\n quote U S A quote,\r\n quote W H O quote,\r\n quote F A T O S quote\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MultiWordTokens(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"MultiWordTokens\"');\r\n function camelCase(words) {\r\n return words.map((a, i) => i ? a.charAt(0).toUpperCase() + a.slice(1) : a);\r\n }\r\n if (((_a = command.extra) === null || _a === void 0 ? void 0 : _a.case) === 'camel') {\r\n return camelCase(command.words);\r\n }\r\n return command.words;\r\n}\r\nexports.default = MultiWordTokens;\r\n","phrases":["quote blue car quote","quote multi word token quote","quote to upper case quote","quote to string quote","quote to integer quote","quote is null quote","quote has next quote","quote is full quote","quote camel case quote","quote get string could quote","quote get color quote","quote really good function quote","quote U S A quote","quote W H O quote","quote F A T O S quote"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg84"},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"},"parent":"sg86"},{"v":"5","value":{"shape":"circle"},"parent":"sg84"},{"v":"sg84","value":{"shape":"circle"}},{"v":"sg86","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(new)"}},{"v":"5","w":"1","value":{"label":"(new)"}},{"v":"1","w":"2","value":{"label":"(line)"}},{"v":"5","w":"2","value":{"label":"(line)"}},{"v":"2","w":"3","value":{"label":"(above, below)","store":"position"}},{"v":"4","w":"3","value":{"label":"(above, below)","store":"position"}},{"v":"0","w":"4","value":{"label":"(line)"}},{"v":"0","w":"5","value":{"label":"(create)"}},{"v":"5","w":"5","value":{"label":"(a)"}}],"value":{"id":"new_line","label":"New line","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"New line","desc":"Creates a new line above or below the current line","examples":"\r\n create line,\r\n create a line,\r\n create line above,\r\n create line below\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function newLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"new line.\"');\r\n return await editor.newLine(command.position);\r\n}\r\nexports.default = newLine;\r\n","phrases":["create line","create a line","create line above","create line below"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(number)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"number"}},{"v":"0","w":"3","value":{"label":"({number})","store":"number"}}],"value":{"id":"number","label":"Writes a number","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","priority":"2","title":"Writes a number","desc":"Writes a number in the editor","examples":"\r\n number one,\r\n number four,\r\n number five,\r\n number 43,\r\n number 14,\r\n number 140,\r\n 140,\r\n 123,\r\n 42,\r\n 18\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteNumber(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteNumber\"');\r\n const { number, parent } = command;\r\n if (parent)\r\n return number;\r\n return await editor.write(number);\r\n}\r\nexports.default = WriteNumber;\r\n","phrases":["number one","number four","number five","number 43","number 14","number 140","140","123","42","18"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(remove)"}},{"v":"1","w":"2","value":{"label":"(line)","store":"isLine","normalizer":"boolean"}},{"v":"1","w":"3","value":{"label":"(selection)","store":"isSelection","normalizer":"boolean"}}],"value":{"id":"remove_ln_sec","label":"Remove","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Remove","desc":"Removes the current line or the current selection","examples":"\r\n remove line,\r\n remove selection\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function remove(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"remove line/selection.\"');\r\n if (command.isLine) {\r\n const line = await editor.getLine();\r\n if (line instanceof Error)\r\n throw line;\r\n return await editor.remove(line.lineNumber);\r\n }\r\n else {\r\n return await editor.write('');\r\n }\r\n}\r\nexports.default = remove;\r\n","phrases":["remove line","remove selection"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"doublecircle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"circle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"}},{"v":"13","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(repetition)"}},{"v":"1","w":"2","value":{"label":"(statement)"}},{"v":"2","w":"9","value":{"label":"(for)"}},{"v":"9","w":"10","value":{"label":"(every)"}},{"v":"10","w":"11","value":{"label":"({term})","store":"item"}},{"v":"11","w":"12","value":{"label":"(of, λ)"}},{"v":"12","w":"13","value":{"label":"([expressions])","store":"collection"}},{"v":"2","w":"3","value":{"label":"(from)"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"from"}},{"v":"4","w":"5","value":{"label":"(to)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"to"}},{"v":"6","w":"7","value":{"label":"(step)"}},{"v":"7","w":"8","value":{"label":"([expressions])","store":"step"}}],"value":{"id":"repetition","label":"Repetition Statement","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Creates a for loop statement","desc":"Creates a for loop statement with the provided expressions as parameters","examples":"\r\n repetition statement from [number] to [number],\r\n repetition statement from [number] to [number] step expression variable i plus number 5,\r\n repetition statement for every car of constant cars,\r\n repetition statement for every animal of earth,\r\n repetition statement for every prime of variable primes,\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Repetition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Repetition.\"');\r\n const gap = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n if (command.from == undefined && command.item == undefined) {\r\n text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n }\r\n else if (command.from != null && command.to != null) {\r\n const from = toValue(command.from);\r\n const to = toValue(command.to);\r\n const step = command.step ? toValue(command.step) : 'i + 1';\r\n text = `for(let i = ${from}; i < ${to}; i = ${step}) {\\n\\n}`;\r\n }\r\n else if (command.item != null && command.collection != null) {\r\n const item = command.item;\r\n const collection = toValue(command.collection);\r\n text = `for(const ${item} of ${collection}) {\\n\\n}`;\r\n }\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (command.collection && text.includes(gap)) {\r\n const pos = await editor.findPositionOf(gap);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = Repetition;\r\n","phrases":["repetition statement from 18 to number five","repetition statement from number five to number one step expression variable i plus number 5","repetition statement for every car of constant cars","repetition statement for every animal of earth","repetition statement for every prime of variable primes"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(run)"}},{"v":"1","w":"2","value":{"label":"(current, this)"}},{"v":"2","w":"3","value":{"label":"(file)"}}],"value":{"id":"run","label":"Run file","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Run current file","desc":"Run the current file in the terminal using node","examples":"\r\n run current file,\r\n run this file\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function run(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"run.\"');\r\n const info = await editor.fileInfo();\r\n return await editor.writeOnTerminal('node \"' + info.fileName + '\"');\r\n}\r\nexports.default = run;\r\n","phrases":["run current file","run this file"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"},"parent":"sg94"},{"v":"13","value":{"shape":"circle"}},{"v":"14","value":{"shape":"circle"}},{"v":"15","value":{"shape":"circle"}},{"v":"16","value":{"shape":"circle"}},{"v":"17","value":{"shape":"doublecircle"}},{"v":"18","value":{"shape":"circle"},"parent":"sg90"},{"v":"19","value":{"shape":"circle"}},{"v":"20","value":{"shape":"doublecircle"}},{"v":"sg90","value":{"shape":"circle"}},{"v":"sg94","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(select)"}},{"v":"1","w":"2","value":{"label":"(letter, symbol)"}},{"v":"18","w":"2","value":{"label":"(letter, symbol)"}},{"v":"2","w":"3","value":{"label":"({char})","store":"word"}},{"v":"1","w":"4","value":{"label":"(word)"}},{"v":"18","w":"4","value":{"label":"(word)"}},{"v":"4","w":"20","value":{"label":"([multi_word_token])","store":"word","extraArgs":"{\"case\": \"camel\"}"}},{"v":"4","w":"3","value":{"label":"({term})","store":"word"}},{"v":"1","w":"5","value":{"label":"(from)"}},{"v":"1","w":"18","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"wordPosition"}},{"v":"5","w":"13","value":{"label":"(line)","store":"selectLine"}},{"v":"13","w":"19","value":{"label":"(number)"}},{"v":"13","w":"14","value":{"label":"({number})","store":"from"}},{"v":"19","w":"14","value":{"label":"({number})","store":"from"}},{"v":"14","w":"15","value":{"label":"(to)"}},{"v":"15","w":"16","value":{"label":"(line, λ)"}},{"v":"16","w":"17","value":{"label":"({number})","store":"to"}},{"v":"5","w":"11","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"fromPosition"}},{"v":"5","w":"6","value":{"label":"(letter, symbol)"}},{"v":"11","w":"6","value":{"label":"(letter, symbol)"}},{"v":"6","w":"7","value":{"label":"({char})","store":"from"}},{"v":"7","w":"8","value":{"label":"(to)"}},{"v":"8","w":"9","value":{"label":"(letter, symbol, λ)"}},{"v":"12","w":"9","value":{"label":"(letter, symbol, λ)"}},{"v":"8","w":"12","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"toPosition"}},{"v":"9","w":"10","value":{"label":"({char})","store":"to"}}],"value":{"id":"select","label":"Select","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Select","desc":"Select a piece of the text in the current line","examples":"\r\n select the letter B,\r\n select the symbol 5,\r\n select the letter Q,\r\n select the first letter B,\r\n select the second letter K,\r\n select the last workd this,\r\n select the word ball,\r\n select the word [multi_word_token],\r\n select from line 2 to line 15,\r\n select from line number 45 to line 90,\r\n select from letter A to letter Z,\r\n select from second leter G to last letter P\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Select(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"select\"');\r\n command.word = Array.isArray(command.word) ? command.word.join('') : command.word;\r\n if (command.selectLine != undefined) {\r\n return await editor.select(parseInt(command.from, 10), parseInt(command.to, 10), true);\r\n }\r\n else if (command.word != undefined) {\r\n const occurences = await editor.findPositionOf(command.word);\r\n let wordPosition = parseInt(command.wordPosition, 10) || 1;\r\n if (wordPosition === -1)\r\n wordPosition = occurences.length;\r\n if (occurences.length) {\r\n return await editor.select(occurences[wordPosition - 1][0], occurences[wordPosition - 1][1] - 1, false);\r\n }\r\n throw new Error('Nothing found for string: ' + command.word);\r\n }\r\n const from = command.from || '';\r\n const to = command.to || '';\r\n let fromPos = parseInt(command.fromPosition, 10) || 1;\r\n let toPos = parseInt(command.toPosition, 10) || 1;\r\n if (from === '' || to === '') {\r\n throw new Error('Invalid arguments!');\r\n }\r\n const matchFrom = await editor.findPositionOf(from);\r\n if (fromPos === -1)\r\n fromPos = matchFrom.length;\r\n const pad = matchFrom[fromPos - 1][1] || 0;\r\n const matchTo = await editor.findPositionOf(to, undefined, pad);\r\n if (toPos === -1)\r\n toPos = matchTo.length;\r\n return await editor.select(matchFrom[fromPos - 1][0], pad + matchTo[toPos - 1][0], false);\r\n}\r\nexports.default = Select;\r\n","phrases":["select the letter B","select the symbol 5","select the letter Q","select the first letter B","select the second letter K","select the last workd this","select the word ball","select the word quote get color quote","select from line 2 to line 15","select from line number 45 to line 90","select from letter A to letter Z","select from second leter G to last letter P"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(string, text)"}},{"v":"2","w":"2","value":{"label":"({any})","store":"string"}},{"v":"2","w":"4","value":{"label":"(string, text)"}}],"value":{"id":"string","label":"Writes a string","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Writes a string","desc":"Writes a string in the editor","examples":"\r\n string hello world string,\r\n string null pointer exeception is bad string,\r\n text this can be any piece of writing text,\r\n string hello my name is giovani girogio string,\r\n text what is happening peter text,\r\n text H E L L O text,\r\n string O N U string,\r\n string U S A string\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteString(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteString\"');\r\n command.string = Array.isArray(command.string) ? command.string : [command.string];\r\n const text = '\"' + command.string.join(' ') + '\"';\r\n if (command.parent)\r\n return text;\r\n return await editor.write(text);\r\n}\r\nexports.default = WriteString;\r\n","phrases":["string hello world string","string null pointer exeception is bad string","text this can be any piece of writing text","string hello my name is giovani girogio string","text what is happening peter text","text H E L L O text","string O N U string","string U S A string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(undo, redo)","store":"task"}},{"v":"1","w":"2","value":{"label":"(that)"}},{"v":"1","w":"3","value":{"label":"(last)"}},{"v":"3","w":"4","value":{"label":"(operation, command)"}},{"v":"2","w":"5","value":{"label":"(again)"}},{"v":"4","w":"5","value":{"label":"(again)"}}],"value":{"id":"undo_redo","label":"Undo or redo the last command","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Undo or redo the last operation/command","desc":"Undo or redo the last operation, used to correct mistakes. Just like CTRL + (Z | Y).","examples":"\r\n undo that,\r\n undo that again,\r\n redo the last operation,\r\n undo the last operation again\r\n redo that\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function undoRedo(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Undo/Redo.\"');\r\n const task = command.task;\r\n if (task === 0)\r\n return await editor.undo();\r\n else\r\n return await editor.redo();\r\n}\r\nexports.default = undoRedo;\r\n","phrases":["undo that","undo that again","redo the last operation","undo the last operation again","redo that"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(new, declare, create)","store":"isNew","normalizer":"boolean"}},{"v":"0","w":"2","value":{"label":"(variable, constant)","store":"memType"}},{"v":"1","w":"2","value":{"label":"(variable, constant)","store":"memType"}},{"v":"2","w":"3","value":{"label":"(called, named)"}},{"v":"3","w":"4","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"2","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"3","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"(equals, =)"}},{"v":"7","w":"5","value":{"label":"(equals, =)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"expression"}}],"value":{"id":"variable_assignment","label":"Stores a value in a variable","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Stores a value in a variable","desc":"Stores a number, string etc in a variable","examples":"\r\n new variable value equals [expressions],\r\n variable called batch equals [expressions],\r\n declare variable called [multi_word_token] equals [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function NewVariable(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"NewVariable\"');\r\n let { isNew, varName, expression, memType } = command;\r\n const value = typeof expression === 'string' ? expression : expression === null || expression === void 0 ? void 0 : expression.value;\r\n const allocate = memType === 0 ? 'let ' : 'const ';\r\n varName = Array.isArray(varName) ? varName.join('') : varName;\r\n const text = `${isNew ? allocate : ''}${varName}${value ? ` = ${value}` : ''}`;\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (typeof expression !== 'string' && (expression === null || expression === void 0 ? void 0 : expression.value) != null) {\r\n const pos = await editor.findPositionOf(expression.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nexports.default = NewVariable;\r\n","phrases":["new variable value equals execute function remove on number 140","variable called batch equals number 140","declare variable called quote blue car quote equals constant age"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(reference)"}},{"v":"0","w":"2","value":{"label":"(variable, constant)"}},{"v":"1","w":"2","value":{"label":"(variable, constant)"}},{"v":"0","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"1","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"6","w":"2","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"(called)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}}],"value":{"id":"variable_reference","label":"References a variable","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"References a variable","desc":"Writes a variable or constant in the editor","examples":"\r\n variable value,\r\n variable label,\r\n constant name,\r\n constant age,\r\n constant language,\r\n namespace color,\r\n reference variable horse,\r\n reference constant bike,\r\n reference namespace bike,\r\n namespace called [multi_word_token],\r\n constant called [multi_word_token],\r\n variable called [multi_word_token],\r\n reference variable called [multi_word_token],\r\n reference constant called [multi_word_token]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function VariableReference(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"VariableReference\"');\r\n let { varName, parent, isNamespace = false } = command;\r\n varName = Array.isArray(varName) ? varName : [varName];\r\n varName = isNamespace ? varName.map(a => a[0].toUpperCase() + a.substr(1)).join('') : varName.join('');\r\n if (parent)\r\n return varName;\r\n return await editor.write(varName);\r\n}\r\nexports.default = VariableReference;\r\n","phrases":["variable value","variable label","constant name","constant age","constant language","namespace color","reference variable horse","reference constant bike","reference namespace bike","namespace called quote camel case quote","constant called quote is full quote","variable called quote to integer quote","reference variable called quote has next quote","reference constant called quote U S A quote"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"},"parent":"sg114"},{"v":"10","value":{"shape":"doublecircle"}},{"v":"sg114","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(print)"}},{"v":"0","w":"2","value":{"label":"(write)"}},{"v":"2","w":"1","value":{"label":"(down, λ)"}},{"v":"2","w":"3","value":{"label":"(it)"}},{"v":"3","w":"1","value":{"label":"(down, λ)"}},{"v":"1","w":"4","value":{"label":"(space)","store":"isSpace","normalizer":"boolean"}},{"v":"1","w":"5","value":{"label":"({any})","store":"text"}},{"v":"5","w":"5","value":{"label":"({any})","store":"text"}},{"v":"1","w":"6","value":{"label":"(letter)","store":"isDitaction","normalizer":"boolean"}},{"v":"6","w":"7","value":{"label":"({char})","store":"text"}},{"v":"9","w":"7","value":{"label":"({char})","store":"text"}},{"v":"7","w":"8","value":{"label":"(and)"}},{"v":"8","w":"9","value":{"label":"(letter)"}},{"v":"1","w":"10","value":{"label":"(dot)","store":"isDot","normalizer":"boolean"}}],"value":{"id":"write","label":"Write text","lang":"en-US","langName":"English","pad":"0.2","disableStopWords":"true","rankdir":"LR","title":"Write text","desc":"Write some text in the editor","examples":"\r\n write hello how are you friend,\r\n print my name is Giovani,\r\n print it down how are you mate,\r\n write letter B and letter E and letter T\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function write(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"write.\"');\r\n let text = null;\r\n if (command.isSpace)\r\n text = ' ';\r\n else if (command.isDot)\r\n text = '.';\r\n else\r\n text = Array.isArray(command.text) ? (_a = command.text) === null || _a === void 0 ? void 0 : _a.join(command.isDitaction ? '' : ' ') : command.text;\r\n return await editor.write(text);\r\n}\r\nexports.default = write;\r\n","phrases":["write hello how are you friend","print my name is Giovani","print it down how are you mate","write letter B and letter E and letter T"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(change, switch)"}},{"v":"1","w":"2","value":{"label":"(language)"}},{"v":"2","w":"3","value":{"label":"(back)"}},{"v":"2","w":"4","value":{"label":"(portuguese)","sem":"to"}},{"v":"3","w":"4","value":{"label":"(portuguese)","sem":"to"}}],"value":{"id":"__change_lang","label":"Change input language","lang":"en-US","langName":"English","pad":"0.2","rankdir":"LR","title":"Change input language","desc":"Changes input language to portuguese","examples":"\r\n change language to portuguese,\r\n switch language to portuguese,\r\n switch language to english,\r\n switch language back to french\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function changeLang(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"changeLang.\"');\r\n console.log('This is an internal command this file should never run!');\r\n return null;\r\n}\r\nexports.default = changeLang;\r\n","phrases":["change language to portuguese","switch language to portuguese","switch language to english","switch language back to french"]}}],"pt-BR":[{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(estrutura)"}},{"v":"1","w":"2","value":{"label":"(condicional)"}},{"v":"2","w":"3","value":{"label":"(se)","disableSpellcheck":"true"}},{"v":"2","w":"7","value":{"label":"([expressions])","store":"condition"}},{"v":"3","w":"7","value":{"label":"([expressions])","store":"condition"}},{"v":"3","w":"6","value":{"label":"(se)","disableSpellcheck":"true"}},{"v":"6","w":"4","value":{"label":"(não)","store":"otherwise","normalizer":"boolean","disableSpellcheck":"true"}},{"v":"3","w":"4","value":{"label":"(senão, sinal)","store":"otherwise","normalizer":"boolean","disableSpellcheck":"true"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"condition"}}],"value":{"id":"condition","label":"Estrutura condicional","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Estrutura condicional","desc":"Cria uma estrutura condicional if/else","examples":"\r\n estrutura condicional,\r\n estrutura condicional [expressions],\r\n estrutura condicional se [expressions],\r\n estrutura condicional se senão [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Condition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Condition.\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let { condition = anything, otherwise = false } = command;\r\n condition = typeof condition === 'string' ? condition : condition === null || condition === void 0 ? void 0 : condition.value;\r\n let text = `if(${condition}) {\\n\\n}${otherwise ? ' else {\\n\\n}' : ''}`;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (condition.includes(anything)) {\r\n const pos = await editor.findPositionOf(anything);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nexports.default = Condition;\r\n","phrases":["estrutura condicional","estrutura condicional gap","estrutura condicional se número 140","estrutura condicional se senão número 140"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"},"parent":"sg63"},{"v":"8","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"doublecircle"}},{"v":"13","value":{"shape":"circle"}},{"v":"sg63","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(cursor, ponteiro)"}},{"v":"1","w":"2","value":{"label":"(linha)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"line"}},{"v":"1","w":"5","value":{"label":"(símbolo, letra)"}},{"v":"7","w":"5","value":{"label":"(símbolo, letra)"}},{"v":"1","w":"7","value":{"label":"({ordinalNumber})","store":"leapSize","normalizer":"ordinalNumber"}},{"v":"5","w":"6","value":{"label":"({char})","store":"symbol"}},{"v":"1","w":"8","value":{"label":"(começo, final)","store":"linePosition"}},{"v":"8","w":"10","value":{"label":"(linha)","sem":"da"}},{"v":"1","w":"11","value":{"label":"(próximo)"}},{"v":"11","w":"13","value":{"label":"({number})","store":"leapSize"}},{"v":"11","w":"12","value":{"label":"(símbolo, letra)"}},{"v":"13","w":"12","value":{"label":"(símbolo, letra)"}}],"value":{"id":"cursor","label":"Mover o cursor","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Mover o cursor","desc":"Move o cursor para uma linha ou símbolo","examples":"\r\n ponteiro linha 21,\r\n ponteiro linha 44,\r\n cursor linha 23,\r\n ponteiro final da linha,\r\n ponteiro começo da linha,\r\n ponteiro primeira letra A,\r\n ponteiro próximos 5 símbolos\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function cursor(args, editor, context) {\r\n console.log('[Spoken]: Executing: \"cursor.\"');\r\n if (args.linePosition != null) {\r\n const pos = args.linePosition === LinePostionEnum.BEGIN ? 'BEGIN_LINE' : 'END_LINE';\r\n return await editor.moveCursorTo(pos);\r\n }\r\n else if (args.line) {\r\n return await editor.goToLine(args.line);\r\n }\r\n else if (!args.symbol) {\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo(null, undefined, nth);\r\n }\r\n else {\r\n if (args.leapSize == undefined)\r\n args.leapSize = '1';\r\n const nth = parseInt(args.leapSize || '1', 10);\r\n return await editor.moveCursorTo('SYMBOL', args.symbol, nth);\r\n }\r\n return await editor.moveCursorTo('BEGIN_LINE');\r\n}\r\nvar LinePostionEnum;\r\n(function (LinePostionEnum) {\r\n LinePostionEnum[LinePostionEnum[\"BEGIN\"] = 0] = \"BEGIN\";\r\n LinePostionEnum[LinePostionEnum[\"END\"] = 1] = \"END\";\r\n})(LinePostionEnum || (LinePostionEnum = {}));\r\nexports.default = cursor;\r\n","phrases":["ponteiro linha 21","ponteiro linha 44","cursor linha 23","ponteiro final da linha","ponteiro começo da linha","ponteiro primeira letra A","ponteiro próximos 5 símbolos"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(expressão)"}},{"v":"1","w":"2","value":{"label":"([expressions])","store":"left"}},{"v":"2","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"4","w":"3","value":{"label":"([math_operator], [logical_operator])","store":"operation"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"right"}}],"value":{"id":"elementar_math_op","label":"Operação Matemática Elementar","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Escreve uma operação matemática elementar","desc":"Escreve uma operação matemática elementar (*, -, +, /)","examples":"\r\n expressão [expressions] [math_operator] [expressions],\r\n expressão [expressions] [logical_operator] [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteElementarMathOperation(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteElementarMathOperation\"');\r\n let operation = toArray(command.operation);\r\n let right = toArray(command.right);\r\n let text = toValue(command.left);\r\n for (let i = 0; i < right.length; i++) {\r\n if (operation[i].isNegative) {\r\n if (operation[i].operator === '===')\r\n text += ' !== ' + toValue(right[i]);\r\n else\r\n text = '!(' + text + ' ' + operation[i].operator + ' ' + toValue(right[i]) + ')';\r\n }\r\n else {\r\n text += ' ' + operation[i].operator + ' ' + toValue(right[i]);\r\n }\r\n }\r\n if (command.parent)\r\n return text;\r\n await editor.write(text);\r\n const wildcard = [command.left, ...right].find(item => typeof item !== 'string');\r\n if (wildcard) {\r\n const pos = await editor.findPositionOf(wildcard.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = WriteElementarMathOperation;\r\n","phrases":["expressão falso menos string olá mundo string","expressão gap não e constante idade"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"([number], [string], [variable_reference], [elementar_math_op], [function_call])","store":"expression"}},{"v":"0","w":"2","value":{"label":"(gap)","store":"wildCard","normalizer":"identity"}},{"v":"0","w":"3","value":{"label":"(falso, verdadeiro)","store":"booleanConstants"}}],"value":{"id":"expressions","label":"Escreve uma expressão","lang":"pt-BR","langName":"Português","pad":"0.2","nodesep":"1","ranksep":"2","rankdir":"LR","alias":"true","title":"Escreve uma expressão","desc":"Escreve uma expressão no editor de texto, esse automata foi projetado para ser usado em outros automatas","examples":"\r\n falso,\r\n verdadeiro,\r\n gap,\r\n [number],\r\n [string],\r\n [variable_reference],\r\n [elementar_math_op],\r\n [function_call]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Expression(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Expression\"');\r\n let { expression, parent, wildCard, booleanConstants } = command;\r\n // really ??? (fix later)\r\n if (booleanConstants != null)\r\n expression = booleanConstants == 1 ? 'true' : 'false';\r\n if (parent) {\r\n return expression ? expression : { value: wildCard, isWildCard: true };\r\n }\r\n return await editor.write(expression || wildCard);\r\n}\r\nexports.default = Expression;\r\n","phrases":["falso","verdadeiro","gap","número 140","string olá mundo string","constante idade","expressão string olá mundo string","execute a função normalizar no execute a função normalizar no número 140 com 2 argumentos com 2 argumentos"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(chame, chamar, execute)"}},{"v":"1","w":"2","value":{"label":"(função)","sem":"a"}},{"v":"2","w":"3","value":{"label":"([multi_word_token])","store":"functionName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"3","w":"4","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"({term})","store":"functionName"}},{"v":"4","w":"11","value":{"label":"(da, na, do, no)"}},{"v":"4","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"11","w":"5","value":{"label":"([expressions])","store":"caller"}},{"v":"4","w":"6","value":{"label":"(argumentos)","sem":"com"}},{"v":"5","w":"6","value":{"label":"(argumentos)","sem":"com"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"7","w":"8","value":{"label":"(e)"}},{"v":"8","w":"7","value":{"label":"([expressions])","store":"args"}},{"v":"4","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"com"}},{"v":"5","w":"9","value":{"label":"({number})","store":"argsNumber","sem":"com"}},{"v":"9","w":"10","value":{"label":"(argumentos)"}}],"value":{"id":"function_call","label":"Chama uma função","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","priority":"2","title":"Chama uma função","desc":"Chama uma função com os determinados argumentos no determinado caller","examples":"\r\n execute a função teste,\r\n execute a função normalizar no [expressions] com 2 argumentos,\r\n execute a função remover no [expressions] com os argumentos [expressions] e [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionCall(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionCall\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n const functionName = join(command.functionName);\r\n const argsNumber = command.argsNumber ? parseInt(command.argsNumber, 10) : command.oneArg ? 1 : NaN;\r\n const args = command.args ? toArray(command.args) : [];\r\n const caller = command.caller ? toValue(command.caller) : null;\r\n let text = functionName + '(';\r\n if (argsNumber) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n else if (args.length) {\r\n text += (args.map(item => typeof item === 'string' ? item : anything).join(', '));\r\n }\r\n text += ')';\r\n if (caller)\r\n text = caller + '.' + text;\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nconst toArray = (arg) => Array.isArray(arg) ? arg : [arg];\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nconst join = (item) => typeof item === 'string' ? item : item.join('');\r\nexports.default = FunctionCall;\r\n","phrases":["execute a função teste","execute a função normalizar no constante idade com 2 argumentos","execute a função remover no verdadeiro com os argumentos constante idade e verdadeiro"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(nova, declare, crie)"}},{"v":"1","w":"2","value":{"label":"(função)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"fnName"}},{"v":"3","w":"4","value":{"label":"({number})","store":"argsNumber"}},{"v":"4","w":"5","value":{"label":"(argumentos)"}},{"v":"3","w":"6","value":{"label":"(retorna, retornando)"}},{"v":"5","w":"6","value":{"label":"(retorna, retornando)"}},{"v":"0","w":"6","value":{"label":"(retorne)","store":"returnOnly"}},{"v":"6","w":"7","value":{"label":"([expressions])","store":"returnValue"}}],"value":{"id":"function_declaration","label":"Cria uma função","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","priority":"2","title":"Cria uma função","desc":"Cria uma função com o número de argumentos especificados e um valor de retorno","examples":"\r\n nova função multiplicar com [number] argumentos,\r\n nova função multiplicar com 2 argumentos retorna [expressions],\r\n declare a função dividir retornando [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function FunctionDeclaration(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"FunctionDeclaration\"');\r\n const anything = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang];\r\n let { fnName, argsNumber, returnValue, returnOnly } = command;\r\n argsNumber = argsNumber != null ? parseInt(argsNumber, 10) : 0;\r\n let text = '';\r\n if (returnOnly == undefined) {\r\n text = `function ${fnName}(`;\r\n if (argsNumber > 0) {\r\n text += new Array(argsNumber).fill(anything).join(', ');\r\n }\r\n text += ') {\\n';\r\n if (returnValue != null) {\r\n text += 'return ' + toValue(returnValue);\r\n }\r\n text += '\\n}';\r\n }\r\n else {\r\n text = 'return ' + toValue(returnValue);\r\n }\r\n if (command.parent)\r\n return text;\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n const r = await editor.goToLine(line._line + 1);\r\n if (argsNumber > 0) {\r\n const pos = await editor.findPositionOf(anything[0]);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return r;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = FunctionDeclaration;\r\n","phrases":["nova função multiplicar com número dois argumentos","nova função multiplicar com 2 argumentos retorna gap","declare a função dividir retornando gap"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(vá, vai)"}},{"v":"1","w":"2","value":{"label":"(para)"}},{"v":"2","w":"5","value":{"label":"(a)"}},{"v":"0","w":"3","value":{"label":"(linha)"}},{"v":"1","w":"3","value":{"label":"(linha)"}},{"v":"2","w":"3","value":{"label":"(linha)"}},{"v":"5","w":"3","value":{"label":"(linha)"}},{"v":"3","w":"6","value":{"label":"(número)"}},{"v":"3","w":"4","value":{"label":"({number})","store":"line"}},{"v":"6","w":"4","value":{"label":"({number})","store":"line"}}],"value":{"id":"go_to_line","label":"Trocar linha","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Trocar linha","desc":"Move or cursor para uma linha diferente","examples":"\r\n linha [number],\r\n vá para a linha [number],\r\n linha número [number],\r\n linha [number]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function goToLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"goToLine.\"');\r\n return await editor.goToLine(command.line);\r\n}\r\nexports.default = goToLine;\r\n","phrases":["linha número cinco","vá para a linha número cinco","linha número número 140","linha número 14"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg82"},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"circle"},"parent":"sg82"},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"sg82","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(e, ou, igual, =)","store":"logicalOperator"}},{"v":"2","w":"1","value":{"label":"(e, ou, igual, =)","store":"logicalOperator"}},{"v":"0","w":"2","value":{"label":"(não, negativo)","store":"isNegative","normalizer":"boolean"}},{"v":"0","w":"3","value":{"label":"(menor, maior)","store":"inequalityOperator","disableSpellcheck":"true"}},{"v":"2","w":"3","value":{"label":"(menor, maior)","store":"inequalityOperator","disableSpellcheck":"true"}},{"v":"3","w":"4","value":{"label":"(ou)"}},{"v":"4","w":"5","value":{"label":"(igual, =)","store":"orEqual","normalizer":"boolean"}},{"v":"3","w":"7","value":{"label":"(que)"}},{"v":"5","w":"7","value":{"label":"(a)"}}],"value":{"id":"logical_operator","label":"Escreve um operador lógico","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","alias":"true","title":"Escreve um operador lógico","desc":"Escreve um operador lógico (===, !==, &&, ||, >, <, >=, <=) pensando para ser usado com expressões","examples":"\r\n e,\r\n ou,\r\n igual,\r\n menor que,\r\n maior que,\r\n menor ou igual a,\r\n maior ou igual a,\r\n não igual,\r\n negativo igual,\r\n não e,\r\n não ou\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function LogicalOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"LogicalOperator\"');\r\n const { logicalOperator, isNegative = false, inequalityOperator, orEqual = false } = command;\r\n if (logicalOperator !== undefined) {\r\n const operator = ['&&', '||', '===', '==='][logicalOperator];\r\n return { operator, isNegative };\r\n }\r\n else if (inequalityOperator !== undefined) {\r\n const operator = ['<', '>'][inequalityOperator] + (orEqual ? '=' : '');\r\n return { operator, isNegative };\r\n }\r\n return { operator: 'error', isNegative: false };\r\n}\r\nexports.default = LogicalOperator;\r\n","phrases":["e","ou","igual","menor que","maior que","menor ou igual a","maior ou igual a","não igual","negativo igual","não e","não ou"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(mais, vezes, menos, dividido, módulo, +, x, -, /, %)","store":"mathOperator","disableSpellcheck":"true"}},{"v":"1","w":"1","value":{"label":"(por)"}}],"value":{"id":"math_operator","label":"Escreve um operador matemático","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","alias":"true","title":"Escreve uma operador matemático","desc":"Escreve um operador matemático (*, -, +, /, '%') pensando para ser usado com expressões","examples":"\r\n mais,\r\n vezes,\r\n menos,\r\n dividido por,\r\n módulo\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MathOperator(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"MathOperator\"');\r\n const { mathOperator } = command;\r\n const operator = ['+', '*', '-', '/', '%'][mathOperator % 5] || 'error';\r\n return { operator };\r\n}\r\n// @ts-ignore\r\nexports.default = MathOperator;\r\n","phrases":["mais","vezes","menos","dividido por","módulo"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"3","value":{"label":"(*)"}},{"v":"3","w":"3","value":{"label":"({any})","store":"words"}},{"v":"3","w":"4","value":{"label":"(*)"}}],"value":{"id":"multi_word_token","label":"Agrupa múltiplas palavras","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","title":"Agrupa múltiplas palavras","desc":"Agrupa múltiplas palavras juntas, projetado para ser usado dentro de outros automatas","examples":"\r\n aspas carro azul aspas,\r\n aspas nome composto de múltiplas palavras aspas,\r\n aspas frase parseada aspas,\r\n aspas transação crédito texto aspas,\r\n aspas preço total aspas,\r\n aspas preço por item aspas,\r\n aspas W H O aspas,\r\n aspas N U L L aspas,\r\n aspas A B C D aspas,\r\n aspas camel case aspas,\r\n * hola me nombre es felipe *\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function MultiWordTokens(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"MultiWordTokens\"');\r\n function camelCase(words) {\r\n return words.map((a, i) => i ? a.charAt(0).toUpperCase() + a.slice(1) : a);\r\n }\r\n if (((_a = command.extra) === null || _a === void 0 ? void 0 : _a.case) === 'camel') {\r\n return camelCase(command.words);\r\n }\r\n return command.words;\r\n}\r\nexports.default = MultiWordTokens;\r\n","phrases":["aspas carro azul aspas","aspas nome composto de múltiplas palavras aspas","aspas frase parseada aspas","aspas transação crédito texto aspas","aspas preço total aspas","aspas preço por item aspas","aspas W H O aspas","aspas N U L L aspas","aspas A B C D aspas","aspas camel case aspas","* hola me nombre es felipe *"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"},"parent":"sg87"},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"},"parent":"sg89"},{"v":"5","value":{"shape":"circle"},"parent":"sg87"},{"v":"sg87","value":{"shape":"circle"}},{"v":"sg89","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(nova)"}},{"v":"5","w":"1","value":{"label":"(nova)"}},{"v":"1","w":"2","value":{"label":"(linha)"}},{"v":"5","w":"2","value":{"label":"(linha)"}},{"v":"2","w":"3","value":{"label":"(acima, abaixo)","store":"position"}},{"v":"4","w":"3","value":{"label":"(acima, abaixo)","store":"position"}},{"v":"0","w":"4","value":{"label":"(linha)"}},{"v":"0","w":"5","value":{"label":"(crie)"}},{"v":"5","w":"5","value":{"label":"(uma)"}},{"v":"4","w":"2","value":{"label":"(nova)"}}],"value":{"id":"new_line","label":"Linha nova","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Linha nova","desc":"Cria uma linha nova abaixo ou acima da linha atual","examples":"\r\n criar linha,\r\n nova linha,\r\n nova linha acima,\r\n nova linha abaixo\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function newLine(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"new line.\"');\r\n return await editor.newLine(command.position);\r\n}\r\nexports.default = newLine;\r\n","phrases":["criar linha","nova linha","nova linha acima","nova linha abaixo"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(número)"}},{"v":"2","w":"3","value":{"label":"({number})","store":"number"}}],"value":{"id":"number","label":"Escreve um número","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","priority":"2","title":"Escreve um número","desc":"Escreve um número no editor","examples":"\r\n número dois,\r\n número quatro,\r\n número cinco,\r\n número 43,\r\n número 14,\r\n número 140\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteNumber(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteNumber\"');\r\n const { number, parent } = command;\r\n if (parent)\r\n return number;\r\n return await editor.write(number);\r\n}\r\nexports.default = WriteNumber;\r\n","phrases":["número dois","número quatro","número cinco","número 43","número 14","número 140"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(remover, remova, remove)"}},{"v":"1","w":"2","value":{"label":"(linha)","store":"isLine","normalizer":"boolean"}},{"v":"1","w":"3","value":{"label":"(seleção)","store":"isSelection","normalizer":"boolean"}}],"value":{"id":"remove_ln_sec","label":"Remover","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Remover","desc":"Remove a linha atual ou a seleção","examples":"\r\n remover linha,\r\n remova linha,\r\n remover seleção\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function remove(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"remove line/selection.\"');\r\n if (command.isLine) {\r\n const line = await editor.getLine();\r\n if (line instanceof Error)\r\n throw line;\r\n return await editor.remove(line.lineNumber);\r\n }\r\n else {\r\n return await editor.write('');\r\n }\r\n}\r\nexports.default = remove;\r\n","phrases":["remover linha","remova linha","remover seleção"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"doublecircle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"circle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"}},{"v":"13","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(estrutura)"}},{"v":"1","w":"1","value":{"label":"(de)"}},{"v":"1","w":"2","value":{"label":"(repetição)"}},{"v":"2","w":"9","value":{"label":"(para)"}},{"v":"9","w":"10","value":{"label":"(todo)"}},{"v":"10","w":"11","value":{"label":"({term})","store":"item"}},{"v":"11","w":"12","value":{"label":"(de, da, do, em, λ)"}},{"v":"12","w":"13","value":{"label":"([expressions])","store":"collection"}},{"v":"2","w":"3","value":{"label":"(de, da, do, λ)"}},{"v":"3","w":"4","value":{"label":"([expressions])","store":"from"}},{"v":"4","w":"5","value":{"label":"(até)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"to"}},{"v":"6","w":"7","value":{"label":"(etapa)"}},{"v":"7","w":"8","value":{"label":"([expressions])","store":"step"}}],"value":{"id":"repetition","label":"Estrutura de repetição","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Estrutura de repetição","desc":"Cria uma estrutura de repetição for","examples":"\r\n estrutura de repetição do [number] até [number],\r\n estrutura de repetição do [number] até [number] etapa expressão variável i mais número 5,\r\n estrutura de repetição para todo carro em constante carros,\r\n estrutura de repetição para todo animal na terra,\r\n estrutura de repetição para todo primo na variável primos,\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Repetition(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"Repetition.\"');\r\n const gap = context.templates['@anything'].examples[(_a = command === null || command === void 0 ? void 0 : command.extra) === null || _a === void 0 ? void 0 : _a.lang][0];\r\n let text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n if (command.from == undefined && command.item == undefined) {\r\n text = `for(${gap}; ${gap}; ${gap}) {\\n\\n}`;\r\n }\r\n else if (command.from != null && command.to != null) {\r\n const from = toValue(command.from);\r\n const to = toValue(command.to);\r\n const step = command.step ? toValue(command.step) : 'i + 1';\r\n text = `for(let i = ${from}; i < ${to}; i = ${step}) {\\n\\n}`;\r\n }\r\n else if (command.item != null && command.collection != null) {\r\n const item = command.item;\r\n const collection = toValue(command.collection);\r\n text = `for(const ${item} of ${collection}) {\\n\\n}`;\r\n }\r\n const line = await editor.getLine();\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n await editor.goToLine(line._line + 1);\r\n if (command.collection && text.includes(gap)) {\r\n const pos = await editor.findPositionOf(gap);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return null;\r\n}\r\nconst toValue = (item) => typeof item === 'string' ? item : item.value;\r\nexports.default = Repetition;\r\n","phrases":["estrutura de repetição do número dois até número 43","estrutura de repetição do número dois até número 43 etapa expressão variável i mais número 5","estrutura de repetição para todo carro em constante carros","estrutura de repetição para todo animal na terra","estrutura de repetição para todo primo na variável primos"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(execute, executar)"}},{"v":"1","w":"4","value":{"label":"(este)"}},{"v":"4","w":"3","value":{"label":"(arquivo)"}},{"v":"1","w":"2","value":{"label":"(arquivo)"}},{"v":"2","w":"3","value":{"label":"(atual)"}}],"value":{"id":"run","label":"Executar arquivo","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Executar arquivo","desc":"Executa o arquivo atual no terminal usando node","examples":"\r\n executar este arquivo,\r\n executar arquivo atual\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function run(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"run.\"');\r\n const info = await editor.fileInfo();\r\n return await editor.writeOnTerminal('node \"' + info.fileName + '\"');\r\n}\r\nexports.default = run;\r\n","phrases":["executar este arquivo","executar arquivo atual"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"circle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"}},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"12","value":{"shape":"circle"},"parent":"sg99"},{"v":"13","value":{"shape":"circle"}},{"v":"14","value":{"shape":"circle"}},{"v":"15","value":{"shape":"circle"}},{"v":"16","value":{"shape":"circle"}},{"v":"17","value":{"shape":"doublecircle"}},{"v":"18","value":{"shape":"circle"},"parent":"sg95"},{"v":"19","value":{"shape":"circle"}},{"v":"20","value":{"shape":"doublecircle"}},{"v":"sg95","value":{"shape":"circle"}},{"v":"sg99","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(selecione, selecionar)"}},{"v":"1","w":"2","value":{"label":"(letra, símbolo)"}},{"v":"18","w":"2","value":{"label":"(letra, símbolo)"}},{"v":"2","w":"3","value":{"label":"({char})","store":"word"}},{"v":"1","w":"4","value":{"label":"(palavra)"}},{"v":"18","w":"4","value":{"label":"(palavra)"}},{"v":"4","w":"20","value":{"label":"([multi_word_token])","store":"word","extraArgs":"{\"case\": \"camel\"}"}},{"v":"4","w":"3","value":{"label":"({term})","store":"word"}},{"v":"1","w":"5","value":{"label":"(de, da)"}},{"v":"1","w":"18","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"wordPosition"}},{"v":"5","w":"13","value":{"label":"(linha)","store":"selectLine"}},{"v":"13","w":"19","value":{"label":"(número)"}},{"v":"13","w":"14","value":{"label":"({number})","store":"from"}},{"v":"19","w":"14","value":{"label":"({number})","store":"from"}},{"v":"14","w":"15","value":{"label":"(até)"}},{"v":"15","w":"16","value":{"label":"(linha, λ)"}},{"v":"16","w":"17","value":{"label":"({number})","store":"to"}},{"v":"5","w":"11","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"fromPosition"}},{"v":"5","w":"6","value":{"label":"(letra, símbolo)"}},{"v":"11","w":"6","value":{"label":"(letra, símbolo)"}},{"v":"6","w":"7","value":{"label":"({char})","store":"from"}},{"v":"7","w":"8","value":{"label":"(até)"}},{"v":"8","w":"9","value":{"label":"(letra, símbolo, λ)"}},{"v":"12","w":"9","value":{"label":"(letra, símbolo, λ)"}},{"v":"8","w":"12","value":{"label":"({ordinalNumber})","normalizer":"ordinalNumber","store":"toPosition"}},{"v":"9","w":"10","value":{"label":"({char})","store":"to"}}],"value":{"id":"select","label":"Selecionar","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Selecionar","desc":"Seleciona um pedaço de texto na linha atual","examples":"\r\n selecione a letra B,\r\n selecione a símbolo 5,\r\n selecione a letra Q,\r\n selecione a primeira letra B,\r\n selecione a segunda letra K,\r\n selecione a última palavra valor,\r\n selecione a palavra lista,\r\n selecione a palavra [multi_word_token],\r\n selecione da linha 2 até a linha 15,\r\n selecione da linha número 45 até a linha 90,\r\n selecione da letra A até a letra Z,\r\n selecione da segunda letra G até a última letra P\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function Select(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"select\"');\r\n command.word = Array.isArray(command.word) ? command.word.join('') : command.word;\r\n if (command.selectLine != undefined) {\r\n return await editor.select(parseInt(command.from, 10), parseInt(command.to, 10), true);\r\n }\r\n else if (command.word != undefined) {\r\n const occurences = await editor.findPositionOf(command.word);\r\n let wordPosition = parseInt(command.wordPosition, 10) || 1;\r\n if (wordPosition === -1)\r\n wordPosition = occurences.length;\r\n if (occurences.length) {\r\n return await editor.select(occurences[wordPosition - 1][0], occurences[wordPosition - 1][1] - 1, false);\r\n }\r\n throw new Error('Nothing found for string: ' + command.word);\r\n }\r\n const from = command.from || '';\r\n const to = command.to || '';\r\n let fromPos = parseInt(command.fromPosition, 10) || 1;\r\n let toPos = parseInt(command.toPosition, 10) || 1;\r\n if (from === '' || to === '') {\r\n throw new Error('Invalid arguments!');\r\n }\r\n const matchFrom = await editor.findPositionOf(from);\r\n if (fromPos === -1)\r\n fromPos = matchFrom.length;\r\n const pad = matchFrom[fromPos - 1][1] || 0;\r\n const matchTo = await editor.findPositionOf(to, undefined, pad);\r\n if (toPos === -1)\r\n toPos = matchTo.length;\r\n return await editor.select(matchFrom[fromPos - 1][0], pad + matchTo[toPos - 1][0], false);\r\n}\r\nexports.default = Select;\r\n","phrases":["selecione a letra B","selecione a símbolo 5","selecione a letra Q","selecione a primeira letra B","selecione a segunda letra K","selecione a última palavra valor","selecione a palavra lista","selecione a palavra * hola me nombre es felipe *","selecione da linha 2 até a linha 15","selecione da linha número 45 até a linha 90","selecione da letra A até a letra Z","selecione da segunda letra G até a última letra P"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"2","value":{"label":"(string, text)"}},{"v":"2","w":"2","value":{"label":"({any})","store":"string"}},{"v":"2","w":"4","value":{"label":"(string, text)"}}],"value":{"id":"string","label":"Escreve uma string","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","priority":"2","title":"Escreve uma string","desc":"Escreve uma string no editor","examples":"\r\n string olá mundo string,\r\n string erros de ponteiro nulos são ruims string,\r\n texto podemos dizer qualquer frase texto,\r\n string Olá meu nome é Giovani Giorgio string,\r\n texto e ele vai ligar pra todas até achar uma gata pra dar um passeio texto,\r\n texto U S A texto,\r\n texto B R T texto,\r\n string G R A S S string\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function WriteString(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"WriteString\"');\r\n command.string = Array.isArray(command.string) ? command.string : [command.string];\r\n const text = '\"' + command.string.join(' ') + '\"';\r\n if (command.parent)\r\n return text;\r\n return await editor.write(text);\r\n}\r\nexports.default = WriteString;\r\n","phrases":["string olá mundo string","string erros de ponteiro nulos são ruims string","texto podemos dizer qualquer frase texto","string Olá meu nome é Giovani Giorgio string","texto e ele vai ligar pra todas até achar uma gata pra dar um passeio texto","texto U S A texto","texto B R T texto","string G R A S S string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(desfazer, refazer)","store":"task"}},{"v":"0","w":"2","value":{"label":"(desfaça, refaça)","store":"task"}},{"v":"1","w":"3","value":{"label":"(isso)"}},{"v":"2","w":"3","value":{"label":"(isso)"}},{"v":"1","w":"4","value":{"label":"(último)"}},{"v":"2","w":"4","value":{"label":"(último)"}},{"v":"4","w":"5","value":{"label":"(comando, operação)"}},{"v":"3","w":"6","value":{"label":"(também)"}},{"v":"5","w":"6","value":{"label":"(também)"}}],"value":{"id":"undo_redo","label":"Desfaz ou refaz o último comando","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Refazer ou desfazer a última operação","desc":"Refazer ou desfazer a última operação, usado para corrgir erros.","examples":"\r\n desfaça isso,\r\n desfazer isto,\r\n desfaça a última operação,\r\n refaça isso,\r\n refazer a última operação\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function undoRedo(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"Undo/Redo.\"');\r\n const task = command.task;\r\n if (task === 0)\r\n return await editor.undo();\r\n else\r\n return await editor.redo();\r\n}\r\nexports.default = undoRedo;\r\n","phrases":["desfaça isso","desfazer isto","desfaça a última operação","refaça isso","refazer a última operação"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}},{"v":"5","value":{"shape":"circle"}},{"v":"6","value":{"shape":"doublecircle"}},{"v":"7","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(nova, declare, crie)","store":"isNew","normalizer":"boolean"}},{"v":"0","w":"2","value":{"label":"(variável, constante)","store":"memType"}},{"v":"1","w":"2","value":{"label":"(variável, constante)","store":"memType"}},{"v":"2","w":"3","value":{"label":"(chamada)"}},{"v":"3","w":"4","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}},{"v":"2","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"3","w":"7","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"(igual, =)"}},{"v":"7","w":"5","value":{"label":"(igual, =)"}},{"v":"5","w":"6","value":{"label":"([expressions])","store":"expression"}}],"value":{"id":"variable_assignment","label":"Guarda um valor em uma variável","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Guarda um valor em uma variável","desc":"Guarda um valor, inteiro, texto e etc em uma variável","examples":"\r\n nova variável valor igual a [expressions],\r\n variável valor igual a [expressions],\r\n nova variável chamada [multi_word_token] igual a [expressions]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function NewVariable(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"NewVariable\"');\r\n let { isNew, varName, expression, memType } = command;\r\n const value = typeof expression === 'string' ? expression : expression === null || expression === void 0 ? void 0 : expression.value;\r\n const allocate = memType === 0 ? 'let ' : 'const ';\r\n varName = Array.isArray(varName) ? varName.join('') : varName;\r\n const text = `${isNew ? allocate : ''}${varName}${value ? ` = ${value}` : ''}`;\r\n await editor.write(text);\r\n await editor.indentSelection();\r\n if (typeof expression !== 'string' && (expression === null || expression === void 0 ? void 0 : expression.value) != null) {\r\n const pos = await editor.findPositionOf(expression.value);\r\n if (pos.length) {\r\n return await editor.select(pos[0][0], pos[0][1] - 1, false);\r\n }\r\n }\r\n return undefined;\r\n}\r\nexports.default = NewVariable;\r\n","phrases":["nova variável valor igual a verdadeiro","variável valor igual a verdadeiro","nova variável chamada aspas frase parseada aspas igual a string olá mundo string"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"4","value":{"shape":"circle"}},{"v":"5","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(referência, refira)"}},{"v":"0","w":"2","value":{"label":"(variável, constante)"}},{"v":"1","w":"2","value":{"label":"(variável, constante)"}},{"v":"0","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"1","w":"6","value":{"label":"(namespace)","store":"isNamespace","normalizer":"boolean"}},{"v":"6","w":"2","value":{"label":"(λ)"}},{"v":"2","w":"4","value":{"label":"(chamada)"}},{"v":"2","w":"3","value":{"label":"({term})","store":"varName"}},{"v":"4","w":"5","value":{"label":"([multi_word_token])","store":"varName","extraArgs":"{\"case\": \"camel\"}"}}],"value":{"id":"variable_reference","label":"Referencia a uma variável","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Referencia a uma variável","desc":"Refere a uma variável ou constante já declarada","examples":"\r\n variável valor,\r\n variável descrição,\r\n constante name,\r\n constante idade,\r\n constante linguagem,\r\n namespace cor,\r\n referência variável cavalo,\r\n referência constante bicicleta,\r\n referência namespace bicicleta,\r\n namespace chamado [multi_word_token],\r\n constante chamada [multi_word_token],\r\n variável chamada [multi_word_token],\r\n referêncie variável chamada [multi_word_token],\r\n referêncie constante chamada [multi_word_token]\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function VariableReference(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"VariableReference\"');\r\n let { varName, parent, isNamespace = false } = command;\r\n varName = Array.isArray(varName) ? varName : [varName];\r\n varName = isNamespace ? varName.map(a => a[0].toUpperCase() + a.substr(1)).join('') : varName.join('');\r\n if (parent)\r\n return varName;\r\n return await editor.write(varName);\r\n}\r\nexports.default = VariableReference;\r\n","phrases":["variável valor","variável descrição","constante name","constante idade","constante linguagem","namespace cor","referência variável cavalo","referência constante bicicleta","referência namespace bicicleta","namespace chamado aspas W H O aspas","constante chamada * hola me nombre es felipe *","variável chamada aspas preço total aspas","referêncie variável chamada aspas camel case aspas","referêncie constante chamada aspas frase parseada aspas"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"doublecircle"}},{"v":"2","value":{"shape":"doublecircle"}},{"v":"3","value":{"shape":"doublecircle"}},{"v":"6","value":{"shape":"circle"}},{"v":"7","value":{"shape":"doublecircle"}},{"v":"8","value":{"shape":"circle"}},{"v":"9","value":{"shape":"circle"},"parent":"sg115"},{"v":"10","value":{"shape":"doublecircle"}},{"v":"11","value":{"shape":"circle"}},{"v":"sg115","value":{"shape":"circle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(escreva)"}},{"v":"1","w":"3","value":{"label":"({any})","store":"text"}},{"v":"1","w":"2","value":{"label":"(espaço)","store":"isSpace","normalizer":"boolean"}},{"v":"3","w":"3","value":{"label":"({any})","store":"text"}},{"v":"1","w":"11","value":{"label":"(a)"}},{"v":"11","w":"6","value":{"label":"(letra)","store":"isDitaction","normalizer":"boolean"}},{"v":"6","w":"7","value":{"label":"({char})","store":"text"}},{"v":"9","w":"7","value":{"label":"({char})","store":"text"}},{"v":"7","w":"8","value":{"label":"(e, i)"}},{"v":"8","w":"9","value":{"label":"(letra)"}},{"v":"1","w":"10","value":{"label":"(ponto)","store":"isDot","normalizer":"boolean"}}],"value":{"id":"write","label":"Escrever texto","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","disableStopWords":"true","title":"Escrever texto","desc":"Escreve um pedaço de texto no editor de texto","examples":"\r\n escreva ola como vai você,\r\n escreva apenas um teste,\r\n escreva meu nome é giovani girogio,\r\n escreva letra a B e letra O e letra I\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function write(command, editor, context) {\r\n var _a;\r\n console.log('[Spoken]: Executing: \"write.\"');\r\n let text = null;\r\n if (command.isSpace)\r\n text = ' ';\r\n else if (command.isDot)\r\n text = '.';\r\n else\r\n text = Array.isArray(command.text) ? (_a = command.text) === null || _a === void 0 ? void 0 : _a.join(command.isDitaction ? '' : ' ') : command.text;\r\n return await editor.write(text);\r\n}\r\nexports.default = write;\r\n","phrases":["escreva ola como vai você","escreva apenas um teste","escreva meu nome é giovani girogio","escreva letra a B e letra O e letra I"]}},{"options":{"directed":true,"multigraph":true,"compound":true},"nodes":[{"v":"0","value":{"shape":"circle"}},{"v":"1","value":{"shape":"circle"}},{"v":"2","value":{"shape":"circle"}},{"v":"4","value":{"shape":"doublecircle"}}],"edges":[{"v":"0","w":"1","value":{"label":"(troque, trocar, mude, mudar)"}},{"v":"1","w":"2","value":{"label":"(linguagem)"}},{"v":"2","w":"4","value":{"label":"(inglês)","sem":"para"}}],"value":{"id":"__change_lang","label":"Mudar linguagem de entrada","lang":"pt-BR","langName":"Português","pad":"0.2","rankdir":"LR","title":"Mudar linguagem de entrada","desc":"Mudar linguagem de entrada para inglês","examples":"\r\n mude a linguagem para inglês,\r\n troque a linguagem para inglês,\r\n mudar linguagem para francês,\r\n trocar linguagem para inglês\r\n ","impl":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nasync function changeLang(command, editor, context) {\r\n console.log('[Spoken]: Executing: \"changeLang.\"');\r\n console.log('This is an internal command this file should never run!');\r\n return null;\r\n}\r\nexports.default = changeLang;\r\n","phrases":["mude a linguagem para inglês","troque a linguagem para inglês","mudar linguagem para francês","trocar linguagem para inglês"]}}]},"desc":"Collection of voice commands of the typescript language","label":"Typescript voice commands"}]} \ No newline at end of file