Automattic / Automattic/harper

`SplitWords` suggests splits that are not English (report false positive)

Open
#3,952 1 comment 0 reactions 0 assignees View on GitHub
bug false-positive harper-core linting
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

**What got flagged?**

Four derived words in polished published prose (a law-review article and a
philosophy essay), each drawing a split suggestion from `SplitWords`:

input --> suggestion

`constitutionalism’s` -->`constitutional ism’s`
`unproblematically` --> `unproblematic ally`
`prelinguistic` -->`pre linguistic`
`cocreated` --> `co created`

**Why is this incorrect?**

Whatever the right treatment of a rare derived token is — flagging one for a
second look is defensible, and other tools flag some of these too — here the
*suggested splits* are not English ("constitutional ism’s", "unproblematic
ally", "pre linguistic") or wrong under every style convention ("co created":
closed or hyphenated, never open).

The rule appears to test whether a token can be split into two dictionary words
without checking that the resulting phrase is itself valid — each of these is
ordinary derived vocabulary (`-ism` + possessive, `un- … -ally`, `pre-` adjectives, `co-` verbs).

**Example of correct usage:**

"It happens unproblematically."
"…constitutionalism’s origins…"
"prelinguistic infants"
"The document was cocreated by both teams."

Expected: if the token is unknown, an unknown-word spelling flag may be
appropriate; a split suggestion should be offered only when the split
produces a plausible English phrase.

Measured on harper.js 2.4.0: all four fire with `LongSentences` disabled (the
configuration they were found under); at full defaults, three reproduce in
their source passages as-is, while `unproblematically`'s long sentence draws
a `LongSentences` finding that masks the split suggestion — in a short
sentence it reproduces at full defaults as well.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the four examples with the SplitWords rule and LongSentences disabled, as described for harper.js 2.4.0, then trace the SplitWords implementation and its existing checks. Done means these tokens no longer receive invalid open-word split suggestions while legitimate split suggestions remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.