Date: 2025-11-13 Status: New hypothesis based on transposition semantics
The transposition should be entered when we detect a potential character swap. This happens when:
This suggests characters at positions i and i+1 might be swapped in the input.
Current implementation checks: !bit_vector.is_match(next_match_index) → enter if b[1] = 0
New hypothesis: Should check bit_vector.is_match(next_match_index) → enter if b[1] = 1
For "ab" → "ba":
Then at Input[1] = 'a':
Change line 223 in position.rs from:
&& !bit_vector.is_match(next_match_index)
To:
&& bit_vector.is_match(next_match_index)
Also need to review the Transposing state logic to ensure it correctly completes the transposition.
Maybe Definition 7's b[1] doesn't mean what I think it means. Let me consider:
But this contradicts the standard successor implementation which clearly shows:
// position.rs:736
let match_index = (max_distance as i32 + offset) as usize;
// This checks b[n+offset] which should be b[0] for the current position
Try inverting the condition and test if it fixes the failing tests.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |