Skip to content

fix(core): proper-noun coverage for Apple i-products and product phrases#3436

Open
johndecker3 wants to merge 2 commits into
Automattic:masterfrom
johndecker3:fix-apple-proper-nouns
Open

fix(core): proper-noun coverage for Apple i-products and product phrases#3436
johndecker3 wants to merge 2 commits into
Automattic:masterfrom
johndecker3:fix-apple-proper-nouns

Conversation

@johndecker3
Copy link
Copy Markdown

Issues

Description

Two small gaps in Apple-product coverage:

  1. dictionary.dict: iMac, iPad, iPhone, iPod, iTunes were missing the
    O (proper-noun) flag that their siblings (Apple, Mac, iCloud,
    macOS, MacBook, iOS) already carry. Without O, is_proper_noun()
    returns false and downstream linters skip canonical-capitalization
    for these words.

  2. proper_noun_rules.json (AppleNames): added "Apple iPod" alongside
    the existing Apple iPhone/iPad/iMac entries, plus six commonly
    typed bare multi-word phrases — "MacBook Pro/Air", "Mac Pro/Mini",
    "AirPods Pro/Max" — that users write without the "Apple" prefix.

No new linters, no behavior changes outside the affected dictionary
entries.

Demo

How Has This Been Tested?

  • 5 new tests in orthographic_consistency.rs (iphone/ipad/ipod/imac/itunes
    in full sentences) — confirm the new O flag enables canonical-case
    suggestion via the orthographic consistency linter.
  • 8 new tests in proper_noun_capitalization_linters.rs (apple_ipod +
    three "family" pairs for MacBook/Mac/AirPods) — modeled on the
    existing americas_lowercase / americas_allow_correct pattern.
  • cargo test -p harper-core --lib: full module suites green (31/31
    orthographic_consistency, 48/48 proper_noun_capitalization_linters).

AI Disclosure

  • I am a human and didn't use any AI.
  • I used LLM features of my editor, but not an agent.
  • I used an AI agent interactively.
  • I am an agent or I got an agent to do the work autonomously.

If Your PR Implements or Enhances a Linter

  • I made up the sentences in the unit tests.
  • The sentences in the unit tests were generated by an AI.
  • I'm using examples from the bug report / feature request.
  • I collected real-world sentences for the unit tests.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have considered splitting this into smaller pull requests.

Copy link
Copy Markdown
Collaborator

@hippietrail hippietrail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is definitely good. I only ask for two tweaks.

Comment thread harper-core/dictionary.dict Outdated
iPad/ONgS
iPhone/ONgS
iPod/ONgS
iTunes/ONg
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are all good. It's tricky to decide what to mark as proper noun vs common noun vs proper noun+common noun, especially when we can't rely on the capitalization test.
But actually iTunes should be O only though so was "more wrong" than the others. You can't say "the iTunes" or "an iTunes" or "two iTunes".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick follow-up on the iTunes entry before I make the change — I want to flag a regression concern.

Following your reasoning ("the iTunes" / "an iTunes" / "two iTunes"), I'm with you on dropping N and not adding S. But the peer entries — Disney/Og, Google/OgV, Pixar/Og, and existing iOS/Og — all keep g, and prose containing "iTunes's library" is a usage your three examples don't seem to rule out. Did you intend iTunes/O literally, or iTunes/Og matching those peers? Happy to go either way, just want to make sure I'm not introducing a possessive false-positive against the grain of the dictionary.

Let me know your preference and I'll make the change. Thanks!

Copy link
Copy Markdown
Collaborator

@hippietrail hippietrail May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I always leave of /g from nouns ending in s because whether to put the apostrophe before or after is subtle and confusing and hasn't really been addressed anywhere in Harper that I've seen. I think that's mostly the status quo in the dictionary but I haven't gone through all the old entries that were there before I started contributing.

Hope this helps!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Made the suggested changes.

Comment thread harper-core/proper_noun_rules.json Outdated
"Mac Pro",
"Mac Mini",
"AirPods Pro",
"AirPods Max"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to keep these alphabetically sorted so that future contributors can quickly scan the list to see if something is included or missing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback. I will make the sorting changes to the Apple product list.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All set. New commit that should address both requested changes.

@hippietrail hippietrail added rust Pull requests that update Rust code harper-core dictionary Modification to or question about the curated dictionary labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dictionary Modification to or question about the curated dictionary harper-core rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants