Automattic / Automattic/harper

Feature: Allow words containing dashes (`-`) and spaces (` `) in the custom dictionary.

Open
#3,092 1 comment 0 reactions 0 assignees View on GitHub
enhancement spelling
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

**What problem does this solve?**
Currently, in order to have e.g. the name of a place that contains dashes in its name, you have to put each of its pieces in the custom dictionary.

This is also applicable for spaces, like in the case of `Messerschmitt 109`.

**Proposed Solution**
1. Entries in Harper's dictionary that contain dashes/spaces should be protected against `SpellCheck`, just like ones without.
2. Those words should be suggested to use dashes if dashes are used, and spaces if spaces are used.

**Examples**
`.harper-dictionary.txt` - without this feature:
```
Bernières
sur
Mer
Messerschmitt
109
```

With this feature:
```
Bernières-sur-Mer
Messerschmitt 109
```

**Component**
- [x] Core engine
- [ ] Plugin/Extension
- [ ] Other: _____

Contributor guide

Open the contributing guide

Research direction

Start in the core engine by tracing how entries from `.harper-dictionary.txt` are loaded and how `SpellCheck` handles dictionary words. Verify how hyphenated and space-separated entries are protected and how suggestions preserve their separators, using the existing core-engine behavior as the completion check.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.