const_hoisted_1=/* @__PURE__ */createStaticVNode('<h1id="autocorrect"tabindex="-1">Autocorrect<aclass="header-anchor"href="#autocorrect"aria-label="Permalink to "Autocorrect""></a></h1><p>Therearealotofwordsthatarepronetobeingtypedincorrectly,duetohabit,sequenceorjustusererror.Thisfeatureleveragesyourfirmwaretoautomaticallycorrecttheseerrors,tohelpreducetypos.</p><h2id="how-does-it-work"tabindex="-1">Howdoesitwork?<aclass="header-anchor"href="#how-does-it-work"aria-label="Permalinkto"Howdoesitwork?{#how-does-it-work}""></a></h2><p>Thefeaturemaintainsasmallbufferofrecentkeypresses.Oneachkeypress,itcheckswhetherthebufferendsinarecognizedtypo,andifso,automaticallysendskeystrokestocorrectit.</p><p>Thetrickypartishowtoefficientlycheckthebufferfortypos.Wedon’twanttospendtoomuchmemoryortimeonstoringorsearchingthetypos.Agoodsolutionistorepresentthetyposwithatriedatastructure.Atrieisatreedatastructurewhereeachnodeisaletter,andwordsareformedbyfollowingapathtooneoftheleaves.</p><p><imgsrc="https://i.imgur.com/HL5DP8H.png"alt="Anexampletrie"></p><p>Sincewesearchwhetherthebufferendsinatypo,westorethetriewritinginreverse.Thetrieisqueriedstartingfromthelastletter,thensecondtolastletter,andsoon,untileitheraletterdoesn’tmatchorwereachaleaf,meaningatypowasfound.</p><h2id="how-do-i-enable-autocorrection"tabindex="-1">HowdoIenableAutocorrection<aclass="header-anchor"href="#how-do-i-enable-autocorrection"aria-label="Permalinkto"HowdoIenableAutocorrection{#how-do-i-enable-autocorrection}""></a></h2><p>Inyour<code>rules.mk</code>,addthis:</p><divclass="language-makevp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">make</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"><code><spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">AUTOCORRECT_ENABLE=yes</span></span></code></pre></div><p>Additionally,youwillneedalibraryforautocorrection.Asmallsamplelibraryisincludedbydefault,sothatyoucangetupandrunningrightaway,butyoucanprovideacustomizedlibrary.</p><p>Bydefault,autocorrectisdisabled.Toenableit,youneedtousethe<code>AC_TOGG</code>keycodetoenableit.Thestatusisstoredinpersistentmemory,soyoushouldn'tneedtoenableditagain.</p><h2id="customizing-autocorrect-library"tabindex="-1">Customizingautocorrectlibrary<aclass="header-anchor"href="#customizing-autocorrect-library"aria-label="Permalinkto"Customizingautocorrectlibrary{#customizing-autocorrect-library}""></a></h2><p>Toprovideacustomlibrary,youneedtocreateatextfilewiththecorrections.Forinstance:</p><divclass="language-textvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">text</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"><code><spanclass="line"><span>:thier->their</span></span>\n<spanclass="line"><span>fitler->filter</span></span>\n<spanclass="line"><span>lenght->length</span></span>\n<spanclass="line"><span>ouput->output</span></span>\n<spanclass="line"><span>widht->width</span></span></code></pre></div><p>Thesyntaxis<code>typo->correction</code>.Typosandcorrectionsarecaseinsensitive,andanywhitespacebeforeorafterthetypoandcorrectionisignored.Thetypomustbeonlythelettersa–z,orthespecialcharacter:representingawordbreak.Thecorrectionmayhaveanynon-unicodecharacters.</p><p>Then,run:</p><divclass="language-shvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">sh</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"><code><spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">qmk</span><spanstyle