Repository navigation
Conversation
Found while testing crates/model/src/edit.rs:~505 (change_case_parts, sentence branch) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
aiongg
left a comment
There was a problem hiding this comment.
AI-generated review (Opus). Not a maintainer decision.
No blocking problems found.
Sentence case no longer treats a '.' between two ASCII digits as the end of a sentence. The check reads the characters of all runs, so it also works when the digits sit in different runs.
- crates/model/src/edit.rs:502-504:
is_decimal_pointis bounds-safe: it guardsi > 0beforeall[i - 1]and usesgetfori + 1, andiis always a valid index intoall. - crates/model/src/edit.rs:540: only the sentence branch changes. Title case and the '!' and '?' handling stay as they were.
- Other dotted tokens without digits on both sides, such as 'e.g.' or 'example.com', still start a new sentence. That matches the stated scope.
Claims checked:
- verified: A '.' with an ASCII digit on each side no longer starts a new sentence in sentence case. (crates/model/src/edit.rs:540 sets start only when the '.' is not a decimal point, using is_decimal_point at crates/model/src/edit.rs:502-504, which checks that all[i-1] and all[i+1] are ASCII digits.)
- verified: The check works when the digits are split across run boundaries. (crates/model/src/edit.rs:517 builds
allfrom every part, and crates/model/src/edit.rs:530 uses the global index i = base + j, so the neighbours come from adjacent runs.) - verified: Regular sentence ends, title case, and '!' and '?' handling are unchanged. (crates/model/src/edit.rs:540: the title condition and the '!'/'?' match are untouched. The new term only applies when c == '.' and digits are on both sides.)
Reviewed at 76bd26c.
Recommendation: merge after CI and checks pass.
Found while testing
crates/model/src/edit.rs:~505 (change_case_parts, sentence branch)(no existing issue): Sentence case capitalizes the word after a decimal point.Cause
In the sentence branch of
change_case_parts, every '.', '!' or '?' started a new sentence. A '.' between two digits, as in '3.5' or '1.2', therefore capitalized the next word.Fix
A '.' with an ASCII digit on each side no longer starts a new sentence. The check uses the characters of all runs, so it also works when the digits are split across run boundaries. Regular sentence ends such as 'HELLO. WORLD' behave as before.
Verified
edit::tests::sentence_case_decimal_point_is_not_a_boundary: fails onmainwithout the fix and passes with it (cargo test -p deckcraft-model --lib sentence_case_decimal_point_is_not_a_boundary).cargo xtask cipasses excepttests::east_asian_vertical_text_stands_ideographs_upright, which also fails onmainwithout this change.Not changed
Title case, and '!' and '?' handling. A '.' between digits is the only case treated differently. Other numeric formats, such as thousands separators written with a comma, are unchanged.
🤖 Generated with AI by ApolloOffice, see the Co-Authored-By trailers for the models
Summary by CodeRabbit