diff options
| author | QMK Bot | 2025-11-04 01:12:57 +0100 |
|---|---|---|
| committer | QMK Bot | 2025-11-04 01:12:57 +0100 |
| commit | f1ec600fac8666e5f44aaeca3364189e5a15d335 (patch) | |
| tree | 33191402c51af0b233a512531417782ba8623538 /docs/features/autocorrect.md | |
| parent | c67e4c2caee2102ba863124bfc60caefeffecae1 (diff) | |
| parent | a9739f78681dee290ede955c02b360f5c133f783 (diff) | |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'docs/features/autocorrect.md')
| -rw-r--r-- | docs/features/autocorrect.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/features/autocorrect.md b/docs/features/autocorrect.md index df3f2e0fd8..57024f2cd2 100644 --- a/docs/features/autocorrect.md +++ b/docs/features/autocorrect.md @@ -8,7 +8,7 @@ The feature maintains a small buffer of recent key presses. On each key press, i The tricky part is how to efficiently check the buffer for typos. We don’t want to spend too much memory or time on storing or searching the typos. A good solution is to represent the typos with a trie data structure. A trie is a tree data structure where each node is a letter, and words are formed by following a path to one of the leaves. - + Since we search whether the buffer ends in a typo, we store the trie writing in reverse. The trie is queried starting from the last letter, then second to last letter, and so on, until either a letter doesn’t match or we reach a leaf, meaning a typo was found. @@ -279,7 +279,7 @@ All autocorrection data is stored in a single flat array autocorrect_data. Each * 01 ⇒ branching node: a trie node with multiple children. * 10 ⇒ leaf node: a leaf, corresponding to a typo and storing its correction. - + **Branching node**. Each branch is encoded with one byte for the keycode (KC_A–KC_Z) followed by a link to the child node. Links between nodes are 16-bit byte offsets relative to the beginning of the array, serialized in little endian order. |