getreuer / qmk-keymap

My keymap & reusable QMK gems
Apache License 2.0
301 stars 45 forks source link

Autocorrect apostrophes not respecting colon #15

Closed ochief closed 1 year ago

ochief commented 2 years ago

If you include a colon in front of a word in the dictionary it correctly only modifies the word if that word has a 'word break' in front of it. For words with an apostrophe it seems to ignore the word break.

Repro steps;

  1. Add the following to autocorrection_dict.txt

    :htere -> there :cant -> can't

  2. Run the python file and compile firmware
  3. Type " htere"

    Expected result: there
    Actual result: there
    Result: WORKING
  4. Type "testhtere"

    Expected result: testhtere Actual result: testhtere Result: WORKING

  5. Type " cant"

    Expected result: can't Actual result: can't Result: WORKING

  6. Type " testcant"

    Expected result: testcant Actual result: testcan't Result: BROKEN

getreuer commented 2 years ago

Thanks for the report! I appreciate the clear examples.

I haven't been able to reproduce the bug yet, unfortunately. I tried appending

:htere -> there
:cant -> can't

to my dictionary, and also tried a dictionary containing only those two entries, yet typing "testcant" isn't triggering autocorrection.

Would you mind to share your full dictionary? (You can make attachments in this thread.) The bug is conceivably a problem in trie encoding.

Do you have special QMK features like mod-taps, Tap Dance, Auto Shift, etc. active on the keys C, A, N, T? Interoperating with QMK's features can be tricky.