[FEATURE]: Allow compound words composed of known dictionary words

Đang mở
#314 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
54/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
tooling

Hướng nghiên cứu

Start by reading the config handling for min_word_length, dictionary lookup, and the camelCase splitter; the issue does not name specific files or tests. Check how configuration is documented and tested, then define completion as an opt-in setting that accepts exactly two dictionary words after a direct lookup miss, with both parts respecting min_word_length.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Labels: enhancement

Lowercase identifiers made of two ordinary English words (gettop,
setflag, runloop) aren't split by the camelCase splitter, so they're
checked as one word and flagged as misspelled. The only workarounds are
literal words entries for each one, or a regex ignore_patterns
workaround that hides part of the word instead of validating it.

Hunspell has COMPOUNDRULE/COMPOUNDMIN for exactly this, but the
bundled en_us rules are too narrow and users can't add their own.

Proposal

An opt-in config key:

allow_compound_words = true

When a word fails direct dictionary lookup, also accept it if it splits
into exactly two parts that are both dictionary words (gettop →
get + top), each respecting min_word_length. Checked only after a
dictionary miss, so the happy path is unaffected.

Deliberate trade-off: some typos pass (gettops if tops is a word) —
the standard compound-word trade-off, hence opt-in. Could also be scoped
per-path via [[overrides]].

Alternative: user-defined word rules

If a simple boolean feels too coarse, the same mechanism could be exposed
as template patterns where {term} matches any word accepted by the
active dictionaries or the words allowlist:

word_patterns = ["{term}{term}", "{term}s"]

This would additionally cover inflected forms of project jargon
(words = ["allowlist"] would then accept allowlists). Happy with
either shape — the boolean is the minimal version, the patterns the more
flexible one.


Ngôn ngữ chính
Rust
Star
925
Fork
59
Merge trung bình
53 phút
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của blopker/codebook

Tất cả issue của blopker/codebook

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.