curran / curran/google-diff-match-patch
Uppercase letter boundary in semantic cleanup
- Dominant language
- Python
- Stars
- 17
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
```
Adding an "uppercase letter boundary" to semantic cleanup score will make code
diffs look nicer.
For example,
cleanupSemanticScore
would be changed to
cleanupSemanticScore
This might be useful in regular texts too (e.g. with people's names -
M[cM]illan => [Mc]Millan)
The change seems to be easy and straightforward:
private int diff_cleanupSemanticScore(String one, String two) {
...
boolean uppercase1 = Character.isUpperCase(char1);
boolean uppercase2 = Character.isUpperCase(char2);
...
else if (!uppercase1 && uppercase2) {
// One point for upper case.
return 1;
}
return 0;
}
```
Original issue reported on code.google.com by `2sa...@gmail.com` on 13 Jun 2012 at 5:00
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.