mirror of
https://github.com/Automattic/harper.git
synced 2025-12-05 19:26:55 -06:00
fix(core): address edge cases in title_case module (#2284)
This commit is contained in:
@@ -7820,6 +7820,7 @@ PRC/ONg # mainland China
|
||||
PRO/N
|
||||
PS/ONgJ # postscript; multiple meanings as implied by the attributes?
|
||||
P.S. # postscript
|
||||
U.S./Og # United States
|
||||
PST/ONg
|
||||
PSU/Sg # power supply unit
|
||||
PT/NOJ
|
||||
@@ -54136,3 +54137,4 @@ topicalization/Nmg
|
||||
typological/JQ
|
||||
volitive/NSgJ
|
||||
worldbuild/Vd>G
|
||||
WordCamp/gO
|
||||
|
||||
@@ -243,4 +243,28 @@ mod tests {
|
||||
"United States"
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keeps_decimal() {
|
||||
assert_eq!(
|
||||
make_title_case_str(
|
||||
"harper turns 1.0 today",
|
||||
&PlainEnglish,
|
||||
&FstDictionary::curated()
|
||||
),
|
||||
"Harper Turns 1.0 Today"
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fixes_odd_capitalized_proper_nouns() {
|
||||
assert_eq!(
|
||||
make_title_case_str(
|
||||
"i spoke at wordcamp u.s. in 2025",
|
||||
&PlainEnglish,
|
||||
&FstDictionary::curated()
|
||||
),
|
||||
"I Spoke at WordCamp U.S. in 2025",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,17 +491,6 @@ Message: |
|
||||
|
||||
|
||||
|
||||
Lint: Spelling (63 priority)
|
||||
Message: |
|
||||
137 | "In the U.S., however, informatics is linked with applied computing, or
|
||||
| ^~~~ Did you mean to spell `U.S.` this way?
|
||||
Suggest:
|
||||
- Replace with: “P.S.”
|
||||
- Replace with: “UBS”
|
||||
- Replace with: “USA”
|
||||
|
||||
|
||||
|
||||
Lint: Spelling (63 priority)
|
||||
Message: |
|
||||
140 | A folkloric quotation, often attributed to—but almost certainly not first
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
> adopted in the UK ( as in the School of Informatics , University of Edinburgh ) .
|
||||
# VP/J NPr/J/R/P D+ NPr+ . NSg/R NPr/J/R/P D N🅪Sg/VB P Nᴹ . NSg P NPr+ . .
|
||||
> " In the U.S. , however , informatics is linked with applied computing , or
|
||||
# . NPr/J/R/P D+ ? . C . Nᴹ VL3 VP/J P VP/J Nᴹ/Vg/J+ . NPr/C
|
||||
# . NPr/J/R/P D+ NPr+ . C . Nᴹ VL3 VP/J P VP/J Nᴹ/Vg/J+ . NPr/C
|
||||
> computing in the context of another domain . "
|
||||
# Nᴹ/Vg/J+ NPr/J/R/P D N🅪Sg/VB P I/D NSg+ . .
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user