-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Current Behavior
Currently, Redlines uses token-level diffing through difflib.SequenceMatcher. When comparing text with small changes (like "dinner" to "dinners"), the entire word is marked as deleted and the new word is inserted, resulting in the entire word being crossed out and rewritten.
Desired Behavior
I would like an option for character-level diffing that only highlights the specific characters that changed.
Some examples:
Original: "have dinner often."
Corrected: "have dinners often."
Current output: "have dinner dinners often."
Desired output: "have dinners often."
Original: "I want eggs also."
Corrected: "I want eggs."
Current output: "I want eggs also. eggs."
Desired output: "I want eggs also."
Note: This feature would only apply to cases where parts of words are added or removed, not both -- when words change completely. For example, in the case of "ourself" → "ourselves", the standard token replacement (crossing out and adding) would still apply.
This would make the diff more readable and precise, especially for language learning applications where small grammatical changes are common.
