kotoshu 1.0.2-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. checksums.yaml +7 -0
  2. data/.kotoshu-baseline.json +1 -0
  3. data/.pre-commit-hooks.yaml +18 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +351 -0
  6. data/.yardopts +8 -0
  7. data/CHANGELOG.md +813 -0
  8. data/CLAUDE.md +176 -0
  9. data/CODE_OF_CONDUCT.md +132 -0
  10. data/Cargo.lock +359 -0
  11. data/Cargo.toml +15 -0
  12. data/LICENSE +31 -0
  13. data/README.adoc +1292 -0
  14. data/Rakefile +150 -0
  15. data/SECURITY.md +93 -0
  16. data/TODO.impl/00-cut-0.1.md +121 -0
  17. data/TODO.impl/00-cut-0.2.md +175 -0
  18. data/TODO.impl/00-vision.md +281 -0
  19. data/TODO.impl/01-hunspell-correctness.md +111 -0
  20. data/TODO.impl/02-cli-unification.md +74 -0
  21. data/TODO.impl/03-dynamic-download.md +107 -0
  22. data/TODO.impl/04-language-modules.md +89 -0
  23. data/TODO.impl/05-semantic-path.md +83 -0
  24. data/TODO.impl/06-cjk-support.md +105 -0
  25. data/TODO.impl/07-rtl-support.md +71 -0
  26. data/TODO.impl/08-grammar-engine.md +106 -0
  27. data/TODO.impl/09-integrity-security.md +90 -0
  28. data/TODO.impl/10-testing-ci.md +98 -0
  29. data/TODO.impl/100-full-feature-batch3.md +28 -0
  30. data/TODO.impl/101-int4-tier-experiment.md +32 -0
  31. data/TODO.impl/102-lid-chain.md +28 -0
  32. data/TODO.impl/103-oov-bucket-tables.md +27 -0
  33. data/TODO.impl/104-vscode-marketplace-readiness.md +32 -0
  34. data/TODO.impl/105-personal-dictionary-in-check.md +34 -0
  35. data/TODO.impl/106-native-lid-detection.md +36 -0
  36. data/TODO.impl/107-basic-support-every-staged-language.md +42 -0
  37. data/TODO.impl/108-ko-ne-full-feature.md +37 -0
  38. data/TODO.impl/109-ten-audit.md +26 -0
  39. data/TODO.impl/11-release-v1.md +95 -0
  40. data/TODO.impl/110-sr-latn-and-polish.md +33 -0
  41. data/TODO.impl/111-embedding-bakeoff.md +33 -0
  42. data/TODO.impl/112-deployability-and-gating.md +26 -0
  43. data/TODO.impl/113-language-packs.md +26 -0
  44. data/TODO.impl/114-typo-biencoder-thread.md +33 -0
  45. data/TODO.impl/115-hybrid-retrieval-pricing.md +22 -0
  46. data/TODO.impl/116-baseline-suggestion-skip.md +81 -0
  47. data/TODO.impl/117-deterministic-frequency-tiers.md +110 -0
  48. data/TODO.impl/118-server-gem-floor.md +33 -0
  49. data/TODO.impl/119-embedded-kelly-tiers.md +56 -0
  50. data/TODO.impl/120-setup-metadata-refresh.md +35 -0
  51. data/TODO.impl/121-jekyll-baseline-skip.md +33 -0
  52. data/TODO.impl/122-pack-compression-kpk2.md +66 -0
  53. data/TODO.impl/123-typo-corpus-synthesis.md +55 -0
  54. data/TODO.impl/124-owner-residue.md +19 -0
  55. data/TODO.impl/125-consumer-floor-guards.md +43 -0
  56. data/TODO.impl/126-tier-error-budgets.md +33 -0
  57. data/TODO.impl/127-suggestion-feedback-loop.md +34 -0
  58. data/TODO.impl/128-hybrid-pricing-verdict.md +47 -0
  59. data/TODO.impl/129-pt-fr-corpora.md +23 -0
  60. data/TODO.impl/130-news-truth-0912.md +23 -0
  61. data/TODO.impl/131-hybrid-productization.md +42 -0
  62. data/TODO.impl/132-techniques-page-and-prose.md +27 -0
  63. data/TODO.impl/133-rust-first-distribution.md +68 -0
  64. data/TODO.impl/20-encapsulation-cleanup.md +47 -0
  65. data/TODO.impl/21-autoload-migration.md +64 -0
  66. data/TODO.impl/22-url-pin-single-source-of-truth.md +120 -0
  67. data/TODO.impl/23-fix-url-defaults.md +57 -0
  68. data/TODO.impl/24-cli-auto-setup-prompt.md +76 -0
  69. data/TODO.impl/25-soft-onnxruntime-require.md +75 -0
  70. data/TODO.impl/26-onnx-vocab-json-generation.md +96 -0
  71. data/TODO.impl/27-end-to-end-smoke-spec.md +113 -0
  72. data/TODO.impl/28-readme-quickstart-verification.md +68 -0
  73. data/TODO.impl/29-status-command.md +84 -0
  74. data/TODO.impl/30-language-auto-detection.md +74 -0
  75. data/TODO.impl/31-download-progress.md +58 -0
  76. data/TODO.impl/32-sarif-output-verification.md +72 -0
  77. data/TODO.impl/33-audit-log-rotation.md +54 -0
  78. data/TODO.impl/34-cache-eviction.md +59 -0
  79. data/TODO.impl/35-shell-completion.md +61 -0
  80. data/TODO.impl/36-cleanup-regressions-0.3.1.md +134 -0
  81. data/TODO.impl/37-hunspell-correctness-tier2.md +203 -0
  82. data/TODO.impl/38-onnx-semantic-gating.md +218 -0
  83. data/TODO.impl/39-tier3-and-beyond.md +232 -0
  84. data/TODO.impl/40-spec-drift-cleanup.md +134 -0
  85. data/TODO.impl/50-structure-aware-document-api.md +194 -0
  86. data/TODO.impl/51-grammar-engine-expansion.md +75 -0
  87. data/TODO.impl/52-multi-language-documents.md +95 -0
  88. data/TODO.impl/53-document-plugin-architecture.md +94 -0
  89. data/TODO.impl/54-cjk-support.md +117 -0
  90. data/TODO.impl/55-rtl-support.md +109 -0
  91. data/TODO.impl/56-t4-t5-t6-quality-architecture-ecosystem.md +126 -0
  92. data/TODO.impl/57-t5.1-step3-pure-function-strategies.md +138 -0
  93. data/TODO.impl/58-t5.2-configuration-as-data.md +113 -0
  94. data/TODO.impl/59-yard-api-documentation.md +75 -0
  95. data/TODO.impl/60-lsp-server.md +174 -0
  96. data/TODO.impl/61-editor-ecosystem.md +167 -0
  97. data/TODO.impl/62-framework-integrations.md +159 -0
  98. data/TODO.impl/63-web-playground-wasm.md +186 -0
  99. data/TODO.impl/64-http-api-and-sdks.md +191 -0
  100. data/TODO.impl/65-universal-kotoshu.md +251 -0
  101. data/TODO.impl/66-kotoshu-core.md +169 -0
  102. data/TODO.impl/67-kotoshu-rs-and-access-libraries.md +137 -0
  103. data/TODO.impl/68-sota-adoption.md +152 -0
  104. data/TODO.impl/69-sota-typo-eval.md +74 -0
  105. data/TODO.impl/70-sota-confidence-cascade.md +59 -0
  106. data/TODO.impl/71-sota-nested-model.md +63 -0
  107. data/TODO.impl/72-model2vec-evaluation.md +49 -0
  108. data/TODO.impl/73-rl-reranker.md +42 -0
  109. data/TODO.impl/74-distilled-reranker.md +36 -0
  110. data/TODO.impl/75-llm-evaluator.md +35 -0
  111. data/TODO.impl/76-optional-llm-backend.md +37 -0
  112. data/TODO.impl/77-model-coverage-expansion.md +96 -0
  113. data/TODO.impl/78-in-browser-playground.md +69 -0
  114. data/TODO.impl/79-news-and-releases.md +60 -0
  115. data/TODO.impl/80-ecosystem-docs.md +56 -0
  116. data/TODO.impl/81-editor-reach.md +68 -0
  117. data/TODO.impl/82-doc-formats-and-ignores.md +81 -0
  118. data/TODO.impl/83-models-batch-2.md +56 -0
  119. data/TODO.impl/84-language-modules-wave2.md +75 -0
  120. data/TODO.impl/85-wasm-model-api.md +48 -0
  121. data/TODO.impl/86-site-truth-wave2.md +45 -0
  122. data/TODO.impl/87-lsp-personal-dictionary.md +36 -0
  123. data/TODO.impl/88-cli-directory-mode.md +54 -0
  124. data/TODO.impl/89-framework-integrations-exec.md +59 -0
  125. data/TODO.impl/90-gem-correctness-residues.md +44 -0
  126. data/TODO.impl/91-unicode-and-sv-aff.md +47 -0
  127. data/TODO.impl/92-tier-mirror-cors.md +88 -0
  128. data/TODO.impl/93-python-wheels.md +32 -0
  129. data/TODO.impl/94-site-integrations-docs.md +35 -0
  130. data/TODO.impl/95-editor-action-polish.md +27 -0
  131. data/TODO.impl/96-server-semantic-models.md +50 -0
  132. data/TODO.impl/97-yard-execution.md +73 -0
  133. data/TODO.impl/98-campaign-cleanup.md +78 -0
  134. data/TODO.impl/99-site-truth-performance-docs.md +31 -0
  135. data/conformance/vectors.jsonl +2630 -0
  136. data/data/en/grammar/rules.yaml +851 -0
  137. data/docs/STABILITY-1.0-AUDIT.md +251 -0
  138. data/docs/STABILITY-1.0.md +137 -0
  139. data/docs/cache-architecture.md +502 -0
  140. data/docs/verification-evidence/correct3/pr_body.md +37 -0
  141. data/docs/verification-evidence/correct3/rspec_final.log +5588 -0
  142. data/docs/verification-evidence/correct3/rspec_full.log +4504 -0
  143. data/docs/verification-evidence/correct3/sv.aff +856 -0
  144. data/docs/verification-evidence/correct3/sv.dic +153717 -0
  145. data/examples/01_basic_word_checking.rb +38 -0
  146. data/examples/02_text_document_checking.rb +77 -0
  147. data/examples/03_dictionary_backends.rb +137 -0
  148. data/examples/04_trie_data_structure.rb +146 -0
  149. data/examples/05_suggestion_algorithms.rb +239 -0
  150. data/examples/06_configuration_advanced.rb +287 -0
  151. data/examples/07_multi_language_dictionaries.rb +278 -0
  152. data/exe/kotoshu +6 -0
  153. data/lib/kotoshu/algorithms/capitalization.rb +276 -0
  154. data/lib/kotoshu/algorithms/edit_distance.rb +128 -0
  155. data/lib/kotoshu/algorithms/lookup/affix_form.rb +132 -0
  156. data/lib/kotoshu/algorithms/lookup/compound_checks.rb +209 -0
  157. data/lib/kotoshu/algorithms/lookup/compound_form.rb +50 -0
  158. data/lib/kotoshu/algorithms/lookup.rb +841 -0
  159. data/lib/kotoshu/algorithms/ngram_suggest.rb +367 -0
  160. data/lib/kotoshu/algorithms/permutations.rb +283 -0
  161. data/lib/kotoshu/algorithms/phonet_suggest.rb +162 -0
  162. data/lib/kotoshu/algorithms/soundex.rb +92 -0
  163. data/lib/kotoshu/algorithms/suggest.rb +794 -0
  164. data/lib/kotoshu/algorithms.rb +23 -0
  165. data/lib/kotoshu/analyzers/semantic_analyzer.rb +405 -0
  166. data/lib/kotoshu/analyzers.rb +8 -0
  167. data/lib/kotoshu/baseline/application.rb +18 -0
  168. data/lib/kotoshu/baseline/entry.rb +33 -0
  169. data/lib/kotoshu/baseline/store.rb +175 -0
  170. data/lib/kotoshu/baseline.rb +20 -0
  171. data/lib/kotoshu/cache/base_cache.rb +778 -0
  172. data/lib/kotoshu/cache/cache.rb +91 -0
  173. data/lib/kotoshu/cache/eviction_policy.rb +66 -0
  174. data/lib/kotoshu/cache/frequency_cache.rb +283 -0
  175. data/lib/kotoshu/cache/language_cache.rb +511 -0
  176. data/lib/kotoshu/cache/lookup_cache.rb +166 -0
  177. data/lib/kotoshu/cache/model_cache.rb +1147 -0
  178. data/lib/kotoshu/cache/model_registry.rb +109 -0
  179. data/lib/kotoshu/cache/staged_languages.rb +45 -0
  180. data/lib/kotoshu/cache/suggestion_cache.rb +113 -0
  181. data/lib/kotoshu/cache.rb +49 -0
  182. data/lib/kotoshu/cli/auto_setup.rb +71 -0
  183. data/lib/kotoshu/cli/baseline_command.rb +119 -0
  184. data/lib/kotoshu/cli/batch_reporter.rb +321 -0
  185. data/lib/kotoshu/cli/cache_command.rb +282 -0
  186. data/lib/kotoshu/cli/completions_command.rb +210 -0
  187. data/lib/kotoshu/cli/dict_command.rb +64 -0
  188. data/lib/kotoshu/cli/directory_check.rb +146 -0
  189. data/lib/kotoshu/cli/directory_walker.rb +132 -0
  190. data/lib/kotoshu/cli/display_formatter.rb +429 -0
  191. data/lib/kotoshu/cli/errors.rb +36 -0
  192. data/lib/kotoshu/cli/ignore_matcher.rb +205 -0
  193. data/lib/kotoshu/cli/interactive_reviewer.rb +314 -0
  194. data/lib/kotoshu/cli/language_resolver.rb +91 -0
  195. data/lib/kotoshu/cli/navigation_manager.rb +273 -0
  196. data/lib/kotoshu/cli/personal_command.rb +113 -0
  197. data/lib/kotoshu/cli/progress_reporter.rb +114 -0
  198. data/lib/kotoshu/cli/status_report.rb +130 -0
  199. data/lib/kotoshu/cli.rb +880 -0
  200. data/lib/kotoshu/components/passthrough_spell_checker.rb +70 -0
  201. data/lib/kotoshu/components/pos_tagger.rb +98 -0
  202. data/lib/kotoshu/components/spell_checker.rb +73 -0
  203. data/lib/kotoshu/components/synthesizer.rb +60 -0
  204. data/lib/kotoshu/components/tokenizer.rb +58 -0
  205. data/lib/kotoshu/components/whitespace_tokenizer.rb +94 -0
  206. data/lib/kotoshu/components.rb +13 -0
  207. data/lib/kotoshu/configuration/builder.rb +207 -0
  208. data/lib/kotoshu/configuration/resolver.rb +124 -0
  209. data/lib/kotoshu/configuration.rb +829 -0
  210. data/lib/kotoshu/conformance_exporter.rb +256 -0
  211. data/lib/kotoshu/conformance_runner.rb +176 -0
  212. data/lib/kotoshu/core/exceptions.rb +186 -0
  213. data/lib/kotoshu/core/indexed_dictionary.rb +293 -0
  214. data/lib/kotoshu/core/models/affix_rule.rb +262 -0
  215. data/lib/kotoshu/core/models/result/document_result.rb +132 -0
  216. data/lib/kotoshu/core/models/result/word_result.rb +131 -0
  217. data/lib/kotoshu/core/models/word.rb +131 -0
  218. data/lib/kotoshu/core/trie/builder.rb +119 -0
  219. data/lib/kotoshu/core/trie/node.rb +94 -0
  220. data/lib/kotoshu/core/trie/trie.rb +249 -0
  221. data/lib/kotoshu/core.rb +28 -0
  222. data/lib/kotoshu/data/common_words/de.yml +1800 -0
  223. data/lib/kotoshu/data/common_words/en.yml +1215 -0
  224. data/lib/kotoshu/data/common_words/es.yml +750 -0
  225. data/lib/kotoshu/data/common_words/fr.yml +1015 -0
  226. data/lib/kotoshu/data/common_words/pt.yml +870 -0
  227. data/lib/kotoshu/data/common_words/ru.yml +484 -0
  228. data/lib/kotoshu/data/common_words_loader.rb +141 -0
  229. data/lib/kotoshu/data/frozen_kelly/en.json +1154 -0
  230. data/lib/kotoshu/data/frozen_kelly.rb +38 -0
  231. data/lib/kotoshu/data.rb +8 -0
  232. data/lib/kotoshu/data_structures/bloom_filter.rb +188 -0
  233. data/lib/kotoshu/data_structures.rb +8 -0
  234. data/lib/kotoshu/debug_logger.rb +146 -0
  235. data/lib/kotoshu/debug_mode.rb +136 -0
  236. data/lib/kotoshu/defaults.rb +84 -0
  237. data/lib/kotoshu/dictionaries/catalog.rb +814 -0
  238. data/lib/kotoshu/dictionaries.rb +8 -0
  239. data/lib/kotoshu/dictionary/base.rb +324 -0
  240. data/lib/kotoshu/dictionary/cspell.rb +243 -0
  241. data/lib/kotoshu/dictionary/custom.rb +225 -0
  242. data/lib/kotoshu/dictionary/hunspell.rb +520 -0
  243. data/lib/kotoshu/dictionary/plain_text.rb +302 -0
  244. data/lib/kotoshu/dictionary/repository.rb +246 -0
  245. data/lib/kotoshu/dictionary/unified.rb +236 -0
  246. data/lib/kotoshu/dictionary/unix_words.rb +218 -0
  247. data/lib/kotoshu/dictionary.rb +15 -0
  248. data/lib/kotoshu/documents/document.rb +120 -0
  249. data/lib/kotoshu/documents/plain_text_document.rb +73 -0
  250. data/lib/kotoshu/documents/source_position.rb +45 -0
  251. data/lib/kotoshu/documents/source_range.rb +76 -0
  252. data/lib/kotoshu/documents/suppressions/scanner.rb +149 -0
  253. data/lib/kotoshu/documents/suppressions/suppression.rb +75 -0
  254. data/lib/kotoshu/documents/suppressions.rb +44 -0
  255. data/lib/kotoshu/documents/text_node.rb +49 -0
  256. data/lib/kotoshu/documents.rb +178 -0
  257. data/lib/kotoshu/embeddings/embedding_pipeline.rb +238 -0
  258. data/lib/kotoshu/embeddings/lru_cache.rb +244 -0
  259. data/lib/kotoshu/embeddings/onnx_runtime_model.rb +411 -0
  260. data/lib/kotoshu/embeddings/protocol.rb +96 -0
  261. data/lib/kotoshu/embeddings/protocols.rb +23 -0
  262. data/lib/kotoshu/embeddings/registry.rb +184 -0
  263. data/lib/kotoshu/embeddings/search.rb +204 -0
  264. data/lib/kotoshu/embeddings/similarity_engine.rb +278 -0
  265. data/lib/kotoshu/embeddings/similarity_search.rb +328 -0
  266. data/lib/kotoshu/embeddings/vocabulary.rb +306 -0
  267. data/lib/kotoshu/embeddings.rb +87 -0
  268. data/lib/kotoshu/fluent_checker.rb +94 -0
  269. data/lib/kotoshu/grammar/pattern_matchers/base_matcher.rb +48 -0
  270. data/lib/kotoshu/grammar/pattern_matchers/double_negative_matcher.rb +179 -0
  271. data/lib/kotoshu/grammar/pattern_matchers/phrase_matcher.rb +86 -0
  272. data/lib/kotoshu/grammar/pattern_matchers/possessive_context_matcher.rb +75 -0
  273. data/lib/kotoshu/grammar/pattern_matchers/possessive_contraction_matcher.rb +87 -0
  274. data/lib/kotoshu/grammar/pattern_matchers/sentence_start_matcher.rb +84 -0
  275. data/lib/kotoshu/grammar/pattern_matchers/vowel_sound_matcher.rb +81 -0
  276. data/lib/kotoshu/grammar/pattern_matchers/word_list_matcher.rb +66 -0
  277. data/lib/kotoshu/grammar/rule.rb +99 -0
  278. data/lib/kotoshu/grammar/rule_engine.rb +96 -0
  279. data/lib/kotoshu/grammar/rule_loader.rb +30 -0
  280. data/lib/kotoshu/grammar.rb +24 -0
  281. data/lib/kotoshu/integrity/audit_log.rb +167 -0
  282. data/lib/kotoshu/integrity/manifest.rb +116 -0
  283. data/lib/kotoshu/integrity/net_http.rb +51 -0
  284. data/lib/kotoshu/integrity/rotation_policy.rb +88 -0
  285. data/lib/kotoshu/integrity.rb +26 -0
  286. data/lib/kotoshu/jekyll.rb +101 -0
  287. data/lib/kotoshu/keyboard/layout.rb +116 -0
  288. data/lib/kotoshu/keyboard/layouts/arabic.rb +59 -0
  289. data/lib/kotoshu/keyboard/layouts/azerty.rb +55 -0
  290. data/lib/kotoshu/keyboard/layouts/bulgarian.rb +57 -0
  291. data/lib/kotoshu/keyboard/layouts/devanagari_inscript.rb +52 -0
  292. data/lib/kotoshu/keyboard/layouts/dubeolsik.rb +56 -0
  293. data/lib/kotoshu/keyboard/layouts/dvorak.rb +54 -0
  294. data/lib/kotoshu/keyboard/layouts/greek.rb +52 -0
  295. data/lib/kotoshu/keyboard/layouts/hebrew.rb +57 -0
  296. data/lib/kotoshu/keyboard/layouts/hrsl.rb +94 -0
  297. data/lib/kotoshu/keyboard/layouts/jcuken.rb +57 -0
  298. data/lib/kotoshu/keyboard/layouts/latin.rb +266 -0
  299. data/lib/kotoshu/keyboard/layouts/persian.rb +58 -0
  300. data/lib/kotoshu/keyboard/layouts/qwerty.rb +52 -0
  301. data/lib/kotoshu/keyboard/layouts/qwertz.rb +55 -0
  302. data/lib/kotoshu/keyboard/layouts/serbian.rb +59 -0
  303. data/lib/kotoshu/keyboard/layouts/turkish_q.rb +52 -0
  304. data/lib/kotoshu/keyboard/layouts/ukrainian.rb +51 -0
  305. data/lib/kotoshu/keyboard/registry.rb +201 -0
  306. data/lib/kotoshu/keyboard.rb +96 -0
  307. data/lib/kotoshu/kotoshu_native.so +0 -0
  308. data/lib/kotoshu/language/detector.rb +242 -0
  309. data/lib/kotoshu/language/identifier.rb +376 -0
  310. data/lib/kotoshu/language/languages/base.rb +271 -0
  311. data/lib/kotoshu/language/lid_detector.rb +188 -0
  312. data/lib/kotoshu/language/normalizer/arabic.rb +113 -0
  313. data/lib/kotoshu/language/normalizer/base.rb +133 -0
  314. data/lib/kotoshu/language/normalizer/greek.rb +63 -0
  315. data/lib/kotoshu/language/normalizer/hebrew.rb +72 -0
  316. data/lib/kotoshu/language/normalizer/persian.rb +36 -0
  317. data/lib/kotoshu/language/normalizer/turkish.rb +38 -0
  318. data/lib/kotoshu/language/registry.rb +209 -0
  319. data/lib/kotoshu/language/resources/ar/common_words.txt +6753 -0
  320. data/lib/kotoshu/language/resources/ar/confusion_sets.txt +11 -0
  321. data/lib/kotoshu/language/resources/de/common_words.txt +10003 -0
  322. data/lib/kotoshu/language/resources/de/confusion_sets.txt +246 -0
  323. data/lib/kotoshu/language/resources/en/common_words.txt +9979 -0
  324. data/lib/kotoshu/language/resources/en/confusion_sets.txt +871 -0
  325. data/lib/kotoshu/language/resources/es/common_words.txt +9992 -0
  326. data/lib/kotoshu/language/resources/es/confusion_sets.txt +17 -0
  327. data/lib/kotoshu/language/resources/fr/common_words.txt +9993 -0
  328. data/lib/kotoshu/language/resources/fr/confusion_sets.txt +76 -0
  329. data/lib/kotoshu/language/resources/pt/common_words.txt +9977 -0
  330. data/lib/kotoshu/language/resources/pt/confusion_sets.txt +18 -0
  331. data/lib/kotoshu/language/resources/ru/common_words.txt +9951 -0
  332. data/lib/kotoshu/language/resources/ru/confusion_sets.txt +5 -0
  333. data/lib/kotoshu/language/script.rb +128 -0
  334. data/lib/kotoshu/language/segmenter.rb +122 -0
  335. data/lib/kotoshu/language/suika.rb +38 -0
  336. data/lib/kotoshu/language/tokenizer/base.rb +187 -0
  337. data/lib/kotoshu/language/tokenizer/cyrillic_tokenizer.rb +76 -0
  338. data/lib/kotoshu/language/tokenizer/devanagari_tokenizer.rb +70 -0
  339. data/lib/kotoshu/language/tokenizer/french_tokenizer.rb +172 -0
  340. data/lib/kotoshu/language/tokenizer/german_tokenizer.rb +41 -0
  341. data/lib/kotoshu/language/tokenizer/greek_tokenizer.rb +72 -0
  342. data/lib/kotoshu/language/tokenizer/hangul_tokenizer.rb +70 -0
  343. data/lib/kotoshu/language/tokenizer/japanese_tokenizer.rb +55 -0
  344. data/lib/kotoshu/language/tokenizer/latin_tokenizer.rb +153 -0
  345. data/lib/kotoshu/language/tokenizer/portuguese_tokenizer.rb +160 -0
  346. data/lib/kotoshu/language/tokenizer/russian_tokenizer.rb +93 -0
  347. data/lib/kotoshu/language/tokenizer/script_tokenizer.rb +62 -0
  348. data/lib/kotoshu/language/tokenizer/spanish_tokenizer.rb +122 -0
  349. data/lib/kotoshu/language.rb +127 -0
  350. data/lib/kotoshu/languages/ar/language.rb +98 -0
  351. data/lib/kotoshu/languages/bg/language.rb +37 -0
  352. data/lib/kotoshu/languages/ca/language.rb +22 -0
  353. data/lib/kotoshu/languages/cs/language.rb +22 -0
  354. data/lib/kotoshu/languages/da/language.rb +22 -0
  355. data/lib/kotoshu/languages/de/language.rb +554 -0
  356. data/lib/kotoshu/languages/el/language.rb +50 -0
  357. data/lib/kotoshu/languages/en/language.rb +470 -0
  358. data/lib/kotoshu/languages/es/language.rb +476 -0
  359. data/lib/kotoshu/languages/et/language.rb +24 -0
  360. data/lib/kotoshu/languages/fa/language.rb +91 -0
  361. data/lib/kotoshu/languages/fr/language.rb +505 -0
  362. data/lib/kotoshu/languages/he/language.rb +98 -0
  363. data/lib/kotoshu/languages/hr/language.rb +24 -0
  364. data/lib/kotoshu/languages/hu/language.rb +22 -0
  365. data/lib/kotoshu/languages/id/language.rb +25 -0
  366. data/lib/kotoshu/languages/it/language.rb +22 -0
  367. data/lib/kotoshu/languages/ja/language.rb +476 -0
  368. data/lib/kotoshu/languages/ko/language.rb +56 -0
  369. data/lib/kotoshu/languages/latin_base.rb +53 -0
  370. data/lib/kotoshu/languages/lt/language.rb +24 -0
  371. data/lib/kotoshu/languages/lv/language.rb +24 -0
  372. data/lib/kotoshu/languages/nb/language.rb +25 -0
  373. data/lib/kotoshu/languages/ne/language.rb +60 -0
  374. data/lib/kotoshu/languages/nl/language.rb +22 -0
  375. data/lib/kotoshu/languages/nn/language.rb +26 -0
  376. data/lib/kotoshu/languages/pl/language.rb +22 -0
  377. data/lib/kotoshu/languages/pt/language.rb +439 -0
  378. data/lib/kotoshu/languages/ro/language.rb +22 -0
  379. data/lib/kotoshu/languages/ru/language.rb +420 -0
  380. data/lib/kotoshu/languages/sk/language.rb +25 -0
  381. data/lib/kotoshu/languages/sl/language.rb +25 -0
  382. data/lib/kotoshu/languages/sr/language.rb +39 -0
  383. data/lib/kotoshu/languages/sr-Latn/language.rb +35 -0
  384. data/lib/kotoshu/languages/sv/language.rb +22 -0
  385. data/lib/kotoshu/languages/tr/language.rb +36 -0
  386. data/lib/kotoshu/languages/uk/language.rb +38 -0
  387. data/lib/kotoshu/languages/vi/language.rb +22 -0
  388. data/lib/kotoshu/languages.rb +64 -0
  389. data/lib/kotoshu/metrics_collector.rb +238 -0
  390. data/lib/kotoshu/metrics_module.rb +121 -0
  391. data/lib/kotoshu/models/context.rb +119 -0
  392. data/lib/kotoshu/models/embedding_model.rb +181 -0
  393. data/lib/kotoshu/models/fasttext_model.rb +212 -0
  394. data/lib/kotoshu/models/nearest_neighbor.rb +96 -0
  395. data/lib/kotoshu/models/onnx_model.rb +330 -0
  396. data/lib/kotoshu/models/semantic_error.rb +204 -0
  397. data/lib/kotoshu/models/suggestion.rb +106 -0
  398. data/lib/kotoshu/models/word_embedding.rb +97 -0
  399. data/lib/kotoshu/models.rb +27 -0
  400. data/lib/kotoshu/multi_language_checker.rb +127 -0
  401. data/lib/kotoshu/native.rb +83 -0
  402. data/lib/kotoshu/native_backend.rb +131 -0
  403. data/lib/kotoshu/paths.rb +79 -0
  404. data/lib/kotoshu/personal_dictionary.rb +105 -0
  405. data/lib/kotoshu/plugins/plugin.rb +61 -0
  406. data/lib/kotoshu/plugins/registry.rb +118 -0
  407. data/lib/kotoshu/plugins.rb +9 -0
  408. data/lib/kotoshu/project_config.rb +76 -0
  409. data/lib/kotoshu/readers/aff_data.rb +530 -0
  410. data/lib/kotoshu/readers/aff_reader.rb +393 -0
  411. data/lib/kotoshu/readers/condition_checker.rb +125 -0
  412. data/lib/kotoshu/readers/dic_reader.rb +208 -0
  413. data/lib/kotoshu/readers/file_reader.rb +377 -0
  414. data/lib/kotoshu/readers/lookup_builder.rb +584 -0
  415. data/lib/kotoshu/readers/readers.rb +17 -0
  416. data/lib/kotoshu/readers.rb +25 -0
  417. data/lib/kotoshu/resource_bundle.rb +55 -0
  418. data/lib/kotoshu/resource_manager.rb +600 -0
  419. data/lib/kotoshu/results/result.rb +165 -0
  420. data/lib/kotoshu/results.rb +8 -0
  421. data/lib/kotoshu/rspec.rb +163 -0
  422. data/lib/kotoshu/scripts/fasttext_to_onnx.py +275 -0
  423. data/lib/kotoshu/source_registry.rb +104 -0
  424. data/lib/kotoshu/spellchecker/parallel_checker.rb +90 -0
  425. data/lib/kotoshu/spellchecker.rb +406 -0
  426. data/lib/kotoshu/string_metrics.rb +153 -0
  427. data/lib/kotoshu/suggestions/context.rb +43 -0
  428. data/lib/kotoshu/suggestions/frequency_provider.rb +80 -0
  429. data/lib/kotoshu/suggestions/generator.rb +169 -0
  430. data/lib/kotoshu/suggestions/pipeline.rb +135 -0
  431. data/lib/kotoshu/suggestions/semantic_cascade.rb +73 -0
  432. data/lib/kotoshu/suggestions/strategies/base_strategy.rb +315 -0
  433. data/lib/kotoshu/suggestions/strategies/composite_strategy.rb +197 -0
  434. data/lib/kotoshu/suggestions/strategies/edit_distance_strategy.rb +631 -0
  435. data/lib/kotoshu/suggestions/strategies/keyboard_proximity_strategy.rb +207 -0
  436. data/lib/kotoshu/suggestions/strategies/ngram_strategy.rb +165 -0
  437. data/lib/kotoshu/suggestions/strategies/phonetic_strategy.rb +284 -0
  438. data/lib/kotoshu/suggestions/strategies/semantic_strategy.rb +317 -0
  439. data/lib/kotoshu/suggestions/strategies/symspell_strategy.rb +270 -0
  440. data/lib/kotoshu/suggestions/strategies/word_index.rb +78 -0
  441. data/lib/kotoshu/suggestions/suggestion.rb +154 -0
  442. data/lib/kotoshu/suggestions/suggestion_set.rb +270 -0
  443. data/lib/kotoshu/suggestions/sweep_index.rb +137 -0
  444. data/lib/kotoshu/suggestions.rb +29 -0
  445. data/lib/kotoshu/tasks/check_task.rb +104 -0
  446. data/lib/kotoshu/tasks.rb +11 -0
  447. data/lib/kotoshu/validators/spelling_validator.rb +101 -0
  448. data/lib/kotoshu/validators.rb +9 -0
  449. data/lib/kotoshu/version.rb +5 -0
  450. data/lib/kotoshu.rb +538 -0
  451. data/rakelib/compile.rake +10 -0
  452. data/script/validate_all_dictionaries.rb +444 -0
  453. data/scripts/build_native_gem.rb +45 -0
  454. data/scripts/extract_eval_grids.rb +37 -0
  455. data/scripts/generate_frozen_tiers.rb +44 -0
  456. data/sig/kotoshu.rbs +435 -0
  457. data/test_oop.rb +79 -0
  458. metadata +546 -0
@@ -0,0 +1,851 @@
1
+ # English Grammar Rules Configuration
2
+ # All linguistic data in dictionary, not hardcoded
3
+
4
+ metadata:
5
+ language: en
6
+ version: "1.0"
7
+ last_updated: "2026-02-03"
8
+
9
+ rules:
10
+ # ==========================================================================
11
+ # Article Usage Rule: "a" vs "an"
12
+ # ==========================================================================
13
+ - id: EN_A_VS_AN
14
+ name: "a vs an"
15
+ category: articles
16
+ severity: suggestion
17
+ description: |
18
+ Use "an" before vowel sounds and "a" before consonant sounds.
19
+ patterns:
20
+ - context:
21
+ antecedent:
22
+ - token: { regex: "^[aA]$" }
23
+ pos_tag: ["DET", "ART"]
24
+ - token: { regex: "^[aA]n$" }
25
+ pos_tag: ["DET", "ART"]
26
+ consequent:
27
+ token: { regex: "." }
28
+ pos_tag: any
29
+ conditions:
30
+ - type: vowel_check
31
+ description: Check if word starts with vowel sound
32
+ function: vowel_sound_check
33
+ exceptions:
34
+ vowel_sounds: [a, e, i, o, u]
35
+ consonant_sound_exceptions:
36
+ - one
37
+ - once
38
+ - unicorn
39
+ - university
40
+ - european
41
+ silent_consonant_exceptions:
42
+ - hour
43
+ - heir
44
+ - honest
45
+ - herb
46
+ message: 'Use "{expected}" before "{word}"'
47
+ suggestion: null
48
+ suggestions:
49
+ - type: single
50
+ template: "{expected}"
51
+
52
+ # ==========================================================================
53
+ # There/Their/They're Confusion Rule
54
+ # ==========================================================================
55
+ - id: EN_THERE_THEIR
56
+ name: "there/their/they're"
57
+ category: confusion
58
+ severity: warning
59
+ description: |
60
+ Use "their" for possession, "there" for location/existence,
61
+ and "they're" for contraction of "they are".
62
+ patterns:
63
+ - context:
64
+ target_token: "there"
65
+ position: any
66
+ conditions:
67
+ - type: context_check
68
+ description: Check if "there" should be "their"
69
+ function: check_possessive_context
70
+ parameters:
71
+ location_indicators:
72
+ verbs:
73
+ - is
74
+ - was
75
+ - are
76
+ - be
77
+ - been
78
+ - being
79
+ - goes
80
+ - went
81
+ - seems
82
+ - appears
83
+ - looks
84
+ - remains
85
+ - existed
86
+ - stood
87
+ - lay
88
+ - came
89
+ - arrived
90
+ possessive_nouns:
91
+ - social
92
+ - standing
93
+ - parents
94
+ - example
95
+ - birth
96
+ - own
97
+ - home
98
+ - house
99
+ - family
100
+ - life
101
+ - work
102
+ - job
103
+ - business
104
+ - money
105
+ - time
106
+ - way
107
+ - place
108
+ - spot
109
+ - location
110
+ - position
111
+ - hands
112
+ - feet
113
+ - eyes
114
+ - ears
115
+ - head
116
+ - face
117
+ - mind
118
+ - heart
119
+ - soul
120
+ - spirit
121
+ - thoughts
122
+ - feelings
123
+ - emotions
124
+ - beliefs
125
+ - opinions
126
+ - views
127
+ - names
128
+ - titles
129
+ - status
130
+ - role
131
+ - rank
132
+ - efforts
133
+ - actions
134
+ - deeds
135
+ - behavior
136
+ - problems
137
+ - troubles
138
+ - difficulties
139
+ - issues
140
+ - goals
141
+ - dreams
142
+ - hopes
143
+ - wishes
144
+ - desires
145
+ - children
146
+ - friends
147
+ - colleagues
148
+ - teachers
149
+ - students
150
+ - leaders
151
+ - members
152
+ - country
153
+ - nation
154
+ - world
155
+ - society
156
+ - culture
157
+ - history
158
+ - past
159
+ - future
160
+ - present
161
+ - moment
162
+ - side
163
+ - part
164
+ - portion
165
+ - share
166
+ - piece
167
+ - bit
168
+ - value
169
+ - worth
170
+ - importance
171
+ - significance
172
+ - use
173
+ - benefit
174
+ - purpose
175
+ - reason
176
+ - cause
177
+ - story
178
+ - tale
179
+ - account
180
+ - report
181
+ - review
182
+ - idea
183
+ - concept
184
+ - notion
185
+ - theory
186
+ - approach
187
+ - method
188
+ - strategy
189
+ - plan
190
+ - scheme
191
+ - attitude
192
+ - manner
193
+ - style
194
+ - nature
195
+ - character
196
+ - personality
197
+ - qualities
198
+ - skills
199
+ - abilities
200
+ - talents
201
+ - gifts
202
+ - strengths
203
+ - habits
204
+ - customs
205
+ - practices
206
+ - traditions
207
+ - achievements
208
+ - successes
209
+ - failures
210
+ - mistakes
211
+ - experiences
212
+ - adventures
213
+ - journeys
214
+ - travels
215
+ - background
216
+ - origins
217
+ - roots
218
+ - sources
219
+ - beginnings
220
+ - development
221
+ - growth
222
+ - progress
223
+ - changes
224
+ - evolution
225
+ - perspective
226
+ - view
227
+ - outlook
228
+ - stance
229
+ - mindset
230
+ - thinking
231
+ - feeling
232
+ - belief
233
+ - relationship
234
+ - connection
235
+ - bond
236
+ - tie
237
+ - link
238
+ - influence
239
+ - impact
240
+ - effect
241
+ - power
242
+ - authority
243
+ - control
244
+ - command
245
+ - charge
246
+ - leadership
247
+ - responsibility
248
+ - duty
249
+ - obligation
250
+ - task
251
+ - care
252
+ - attention
253
+ - concern
254
+ - interest
255
+ - focus
256
+ - love
257
+ - affection
258
+ - passion
259
+ - devotion
260
+ - respect
261
+ - admiration
262
+ - appreciation
263
+ - knowledge
264
+ - understanding
265
+ - wisdom
266
+ - insight
267
+ - ability
268
+ - capability
269
+ - capacity
270
+ - potential
271
+ - condition
272
+ - state
273
+ - situation
274
+ - quality
275
+ - characteristic
276
+ - feature
277
+ - trait
278
+ - problem
279
+ - issue
280
+ - challenge
281
+ - difficulty
282
+ - solution
283
+ - answer
284
+ - remedy
285
+ - fix
286
+ - result
287
+ - outcome
288
+ - consequence
289
+ - sign
290
+ - signal
291
+ - indicator
292
+ - mark
293
+ - evidence
294
+ - proof
295
+ - indication
296
+ message: 'Consider using "their" instead of "there" for possession'
297
+ suggestion: "their"
298
+
299
+ # ==========================================================================
300
+ # Double Negative Rule
301
+ # ==========================================================================
302
+ - id: EN_DOUBLE_NEGATIVE
303
+ name: "Double Negative"
304
+ category: style
305
+ severity: style
306
+ description: |
307
+ Avoid double negatives in formal English as they can be confusing.
308
+ patterns:
309
+ - context:
310
+ target_tokens:
311
+ - not
312
+ - no
313
+ - neither
314
+ - nobody
315
+ - never
316
+ - nothing
317
+ - nowhere
318
+ - hardly
319
+ - barely
320
+ - scarcely
321
+ pattern: multiple_negatives
322
+ conditions:
323
+ - type: distance_check
324
+ max_distance: 15
325
+ description: Check if another negative word appears within range
326
+ exceptions:
327
+ phrases:
328
+ - not only but also
329
+ - not...without
330
+ message: 'Double negative detected - consider rephrasing'
331
+ suggestion: 'Consider using a single negative'
332
+
333
+ # ==========================================================================
334
+ # Phrase Confusion Rules: phonetic confusions where each word is valid
335
+ # individually but the combination is wrong.
336
+ # ==========================================================================
337
+ - id: EN_COULD_OF
338
+ name: "could of → could have"
339
+ category: grammar
340
+ severity: error
341
+ description: |
342
+ "could of" is a phonetic misspelling of "could have" (the
343
+ contraction "could've" sounds like "could of"). The same
344
+ applies to should/would/must/might of.
345
+ patterns:
346
+ - conditions:
347
+ - type: phrase_check
348
+ wrong_phrase: "could of"
349
+ suggestion: "could have"
350
+ message: '"could of" should be "could have"'
351
+ suggestion: 'could have'
352
+
353
+ - id: EN_SHOULD_OF
354
+ name: "should of → should have"
355
+ category: grammar
356
+ severity: error
357
+ description: |
358
+ "should of" is a phonetic misspelling of "should have".
359
+ patterns:
360
+ - conditions:
361
+ - type: phrase_check
362
+ wrong_phrase: "should of"
363
+ suggestion: "should have"
364
+ message: '"should of" should be "should have"'
365
+ suggestion: 'should have'
366
+
367
+ - id: EN_WOULD_OF
368
+ name: "would of → would have"
369
+ category: grammar
370
+ severity: error
371
+ description: |
372
+ "would of" is a phonetic misspelling of "would have".
373
+ patterns:
374
+ - conditions:
375
+ - type: phrase_check
376
+ wrong_phrase: "would of"
377
+ suggestion: "would have"
378
+ message: '"would of" should be "would have"'
379
+ suggestion: 'would have'
380
+
381
+ - id: EN_MUST_OF
382
+ name: "must of → must have"
383
+ category: grammar
384
+ severity: error
385
+ description: |
386
+ "must of" is a phonetic misspelling of "must have".
387
+ patterns:
388
+ - conditions:
389
+ - type: phrase_check
390
+ wrong_phrase: "must of"
391
+ suggestion: "must have"
392
+ message: '"must of" should be "must have"'
393
+ suggestion: 'must have'
394
+
395
+ - id: EN_MIGHT_OF
396
+ name: "might of → might have"
397
+ category: grammar
398
+ severity: error
399
+ description: |
400
+ "might of" is a phonetic misspelling of "might have".
401
+ patterns:
402
+ - conditions:
403
+ - type: phrase_check
404
+ wrong_phrase: "might of"
405
+ suggestion: "might have"
406
+ message: '"might of" should be "might have"'
407
+ suggestion: 'might have'
408
+
409
+ - id: EN_IN_REGARDS_TO
410
+ name: "in regards to → in regard to"
411
+ category: grammar
412
+ severity: suggestion
413
+ description: |
414
+ "In regards to" is non-standard. The correct form is "in regard to"
415
+ (singular "regard").
416
+ patterns:
417
+ - conditions:
418
+ - type: phrase_check
419
+ wrong_phrase: "in regards to"
420
+ suggestion: "in regard to"
421
+ message: '"in regards to" should be "in regard to"'
422
+ suggestion: 'in regard to'
423
+
424
+ - id: EN_ASK_FOR_ADVICE
425
+ name: "advise vs advice"
426
+ category: grammar
427
+ severity: suggestion
428
+ description: |
429
+ "advise" is a verb; "advice" is a noun. Common phrase confusion:
430
+ "I need an advise" should be "I need advice".
431
+ patterns:
432
+ - conditions:
433
+ - type: phrase_check
434
+ wrong_phrase: "an advise"
435
+ suggestion: "some advice"
436
+ message: '"an advise" should be "advice" (noun, uncountable)'
437
+ suggestion: 'advice'
438
+
439
+ - id: EN_SUPPOSE_TO
440
+ name: "suppose to → supposed to"
441
+ category: grammar
442
+ severity: error
443
+ description: |
444
+ "suppose to" (without the 'd') is a common misspelling of
445
+ "supposed to" — the final consonant of "supposed" is silent
446
+ in connected speech.
447
+ patterns:
448
+ - conditions:
449
+ - type: phrase_check
450
+ wrong_phrase: "suppose to"
451
+ suggestion: "supposed to"
452
+ message: '"suppose to" should be "supposed to"'
453
+ suggestion: 'supposed to'
454
+
455
+ - id: EN_USE_TO
456
+ name: "use to → used to"
457
+ category: grammar
458
+ severity: error
459
+ description: |
460
+ "use to" (without the 'd') is a common misspelling of
461
+ "used to" — same phonetic confusion as "suppose to".
462
+ patterns:
463
+ - conditions:
464
+ - type: phrase_check
465
+ wrong_phrase: "use to"
466
+ suggestion: "used to"
467
+ message: '"use to" should be "used to"'
468
+ suggestion: 'used to'
469
+
470
+ - id: EN_ITS_IT_S
471
+ name: "its/it's"
472
+ category: confusion
473
+ severity: warning
474
+ description: |
475
+ "its" (no apostrophe) is the possessive pronoun — like "his"
476
+ or "her". "it's" (with apostrophe) is a contraction of "it is"
477
+ or "it has". When "its" is followed by an adjective, adverb,
478
+ or past participle, the writer usually meant the contraction.
479
+ message: "Did you mean \"it's\" (contraction of \"it is\")?"
480
+ suggestion: "it's"
481
+ patterns:
482
+ - context:
483
+ target_token: "its"
484
+ trigger_when_followed_by:
485
+ tags: [ADJ, ADV]
486
+ words:
487
+ - been
488
+ - going
489
+ - getting
490
+ - becoming
491
+ - appearing
492
+ - seeming
493
+ - looking
494
+ - feeling
495
+ - sounding
496
+ - tasting
497
+ - smelling
498
+ conditions:
499
+ - type: possessive_contraction_check
500
+
501
+ - id: EN_YOUR_YOURE
502
+ name: "your/you're"
503
+ category: confusion
504
+ severity: warning
505
+ description: |
506
+ "your" is the possessive pronoun. "you're" is a contraction of
507
+ "you are". When "your" is followed by an adjective or past
508
+ participle, the writer usually meant the contraction.
509
+ message: "Did you mean \"you're\" (contraction of \"you are\")?"
510
+ suggestion: "you're"
511
+ patterns:
512
+ - context:
513
+ target_token: "your"
514
+ trigger_when_followed_by:
515
+ tags: [ADJ, ADV]
516
+ words:
517
+ - going
518
+ - getting
519
+ - becoming
520
+ - coming
521
+ - leaving
522
+ - arriving
523
+ - doing
524
+ - making
525
+ - saying
526
+ - thinking
527
+ - feeling
528
+ - looking
529
+ - sounding
530
+ conditions:
531
+ - type: possessive_contraction_check
532
+
533
+ - id: EN_WHOSE_WHOS
534
+ name: "whose/who's"
535
+ category: confusion
536
+ severity: warning
537
+ description: |
538
+ "whose" is the possessive form of "who". "who's" is a
539
+ contraction of "who is" or "who has". When "whose" is followed
540
+ by a verb form, the writer usually meant the contraction.
541
+ message: "Did you mean \"who's\" (contraction of \"who is\")?"
542
+ suggestion: "who's"
543
+ patterns:
544
+ - context:
545
+ target_token: "whose"
546
+ trigger_when_followed_by:
547
+ tags: [VERB]
548
+ words:
549
+ - coming
550
+ - going
551
+ - here
552
+ - there
553
+ - talking
554
+ - speaking
555
+ - calling
556
+ - looking
557
+ - watching
558
+ - working
559
+ - doing
560
+ - making
561
+ - been
562
+ - got
563
+ conditions:
564
+ - type: possessive_contraction_check
565
+
566
+ - id: EN_SENTENCE_START_CAP
567
+ name: "Sentence start capitalization"
568
+ category: capitalization
569
+ severity: error
570
+ description: |
571
+ The first word of a sentence should be capitalized. Sentence
572
+ boundaries are: the start of the stream, or any token whose
573
+ final character is ".", "!", or "?".
574
+ message: "Sentences should start with a capital letter"
575
+ suggestion: "Capitalize the first letter"
576
+ patterns:
577
+ - conditions:
578
+ - type: sentence_start_check
579
+
580
+ - id: EN_PROPER_NOUN_CAP
581
+ name: "Proper noun capitalization"
582
+ category: capitalization
583
+ severity: error
584
+ description: |
585
+ Days of the week, months, languages, and some other common
586
+ proper nouns must be capitalized in English.
587
+ message: "Proper nouns should be capitalized"
588
+ suggestion: "Capitalize the proper noun"
589
+ patterns:
590
+ - conditions:
591
+ - type: word_list_check
592
+ corrections:
593
+ # Days of the week
594
+ monday: Monday
595
+ tuesday: Tuesday
596
+ wednesday: Wednesday
597
+ thursday: Thursday
598
+ friday: Friday
599
+ saturday: Saturday
600
+ sunday: Sunday
601
+ # Months
602
+ january: January
603
+ february: February
604
+ march: March
605
+ april: April
606
+ june: June
607
+ july: July
608
+ august: August
609
+ september: September
610
+ october: October
611
+ november: November
612
+ december: December
613
+ # Languages and nationalities
614
+ english: English
615
+ spanish: Spanish
616
+ french: French
617
+ german: German
618
+ italian: Italian
619
+ russian: Russian
620
+ chinese: Chinese
621
+ japanese: Japanese
622
+ korean: Korean
623
+ arabic: Arabic
624
+ hebrew: Hebrew
625
+ hindi: Hindi
626
+ portuguese: Portuguese
627
+ dutch: Dutch
628
+ swedish: Swedish
629
+ polish: Polish
630
+ turkish: Turkish
631
+ greek: Greek
632
+ latin: Latin
633
+
634
+ - id: EN_MORE_THEN
635
+ name: "more then → more than"
636
+ category: grammar
637
+ severity: error
638
+ description: |
639
+ "more then" is a common confusion. The comparative "more"
640
+ takes "than" (the comparison conjunction), not "then"
641
+ (the time adverb).
642
+ patterns:
643
+ - conditions:
644
+ - type: phrase_check
645
+ wrong_phrase: "more then"
646
+ suggestion: "more than"
647
+ message: '"more then" should be "more than"'
648
+ suggestion: 'more than'
649
+
650
+ - id: EN_LESS_THEN
651
+ name: "less then → less than"
652
+ category: grammar
653
+ severity: error
654
+ description: |
655
+ "less then" is a common confusion. "less" takes "than" for
656
+ comparison.
657
+ patterns:
658
+ - conditions:
659
+ - type: phrase_check
660
+ wrong_phrase: "less then"
661
+ suggestion: "less than"
662
+ message: '"less then" should be "less than"'
663
+ suggestion: 'less than'
664
+
665
+ - id: EN_RATHER_THEN
666
+ name: "rather then → rather than"
667
+ category: grammar
668
+ severity: error
669
+ description: |
670
+ "rather then" is a common confusion. "rather" takes "than"
671
+ in preference constructions ("I would rather X than Y").
672
+ patterns:
673
+ - conditions:
674
+ - type: phrase_check
675
+ wrong_phrase: "rather then"
676
+ suggestion: "rather than"
677
+ message: '"rather then" should be "rather than"'
678
+ suggestion: 'rather than'
679
+
680
+ - id: EN_OTHER_THEN
681
+ name: "other then → other than"
682
+ category: grammar
683
+ severity: error
684
+ description: |
685
+ "other then" is a common confusion. "other than" is the
686
+ correct idiom for "except for" or "apart from".
687
+ patterns:
688
+ - conditions:
689
+ - type: phrase_check
690
+ wrong_phrase: "other then"
691
+ suggestion: "other than"
692
+ message: '"other then" should be "other than"'
693
+ suggestion: 'other than'
694
+
695
+ - id: EN_COULD_CARE_LESS
696
+ name: "could care less → couldn't care less"
697
+ category: grammar
698
+ severity: warning
699
+ description: |
700
+ "I could care less" literally means you DO care (because
701
+ it's possible to care less). The intended idiom is
702
+ "I couldn't care less" (it's impossible to care less
703
+ because you already care zero).
704
+ patterns:
705
+ - conditions:
706
+ - type: phrase_check
707
+ wrong_phrase: "could care less"
708
+ suggestion: "couldn't care less"
709
+ message: "\"could care less\" should be \"couldn't care less\""
710
+ suggestion: "couldn't care less"
711
+
712
+ - id: EN_FOR_FREE
713
+ name: "for free → free"
714
+ category: grammar
715
+ severity: suggestion
716
+ description: |
717
+ "for free" is redundant — "free" already means "at no cost".
718
+ Prefer just "free" (e.g., "I got it free", not "I got it
719
+ for free").
720
+ patterns:
721
+ - conditions:
722
+ - type: phrase_check
723
+ wrong_phrase: "for free"
724
+ suggestion: "free"
725
+ message: '"for free" is redundant — consider just "free"'
726
+ suggestion: 'free'
727
+
728
+ - id: EN_ALOT
729
+ name: "alot → a lot"
730
+ category: grammar
731
+ severity: error
732
+ description: |
733
+ "alot" is not a word. The correct spelling is "a lot"
734
+ (two words). "allot" (verb, to distribute) is a different
735
+ word.
736
+ patterns:
737
+ - conditions:
738
+ - type: phrase_check
739
+ wrong_phrase: "alot"
740
+ suggestion: "a lot"
741
+ message: '"alot" is not a word — use "a lot"'
742
+ suggestion: 'a lot'
743
+
744
+ - id: EN_TO_MUCH
745
+ name: "to much → too much"
746
+ category: grammar
747
+ severity: error
748
+ description: |
749
+ "to much" is a common confusion. The intensifier "too" (meaning
750
+ "excessively") is correct, not the preposition "to".
751
+ patterns:
752
+ - conditions:
753
+ - type: phrase_check
754
+ wrong_phrase: "to much"
755
+ suggestion: "too much"
756
+ message: '"to much" should be "too much"'
757
+ suggestion: 'too much'
758
+
759
+ - id: EN_TO_MANY
760
+ name: "to many → too many"
761
+ category: grammar
762
+ severity: error
763
+ description: |
764
+ "to many" is a common confusion. The intensifier "too" is
765
+ correct before "many".
766
+ patterns:
767
+ - conditions:
768
+ - type: phrase_check
769
+ wrong_phrase: "to many"
770
+ suggestion: "too many"
771
+ message: '"to many" should be "too many"'
772
+ suggestion: 'too many'
773
+
774
+ - id: EN_AS_FOLLOW
775
+ name: "as follow → as follows"
776
+ category: grammar
777
+ severity: error
778
+ description: |
779
+ "as follow" is a common confusion. The fixed expression is
780
+ "as follows" (always with the 's', regardless of subject
781
+ number).
782
+ patterns:
783
+ - conditions:
784
+ - type: phrase_check
785
+ wrong_phrase: "as follow"
786
+ suggestion: "as follows"
787
+ message: '"as follow" should be "as follows"'
788
+ suggestion: 'as follows'
789
+
790
+ - id: EN_BETWEEN_YOU_AND_I
791
+ name: "between you and I → between you and me"
792
+ category: grammar
793
+ severity: error
794
+ description: |
795
+ "between you and I" is a common grammar error. Prepositions
796
+ like "between" take the objective case ("me"), not the
797
+ subjective ("I").
798
+ patterns:
799
+ - conditions:
800
+ - type: phrase_check
801
+ wrong_phrase: "between you and I"
802
+ suggestion: "between you and me"
803
+ message: '"between you and I" should be "between you and me"'
804
+ suggestion: 'between you and me'
805
+
806
+ - id: EN_A_PART
807
+ name: "apart → a part (when joined with of)"
808
+ category: grammar
809
+ severity: warning
810
+ description: |
811
+ "apart of" is a common confusion. "a part of" (with space)
812
+ means "a member of" or "a piece of". "apart" (no space)
813
+ means "separated".
814
+ patterns:
815
+ - conditions:
816
+ - type: phrase_check
817
+ wrong_phrase: "apart of"
818
+ suggestion: "a part of"
819
+ message: '"apart of" should be "a part of"'
820
+ suggestion: 'a part of'
821
+
822
+ - id: EN_IN_SPITE
823
+ name: "inspite → in spite"
824
+ category: grammar
825
+ severity: error
826
+ description: |
827
+ "inspite" is not a word. The correct spelling is "in spite"
828
+ (two words), as in "in spite of".
829
+ patterns:
830
+ - conditions:
831
+ - type: phrase_check
832
+ wrong_phrase: "inspite"
833
+ suggestion: "in spite"
834
+ message: '"inspite" should be "in spite"'
835
+ suggestion: 'in spite'
836
+
837
+ - id: EN_ALRIGHT
838
+ name: "alright → all right"
839
+ category: grammar
840
+ severity: suggestion
841
+ description: |
842
+ "alright" is non-standard. The accepted form is "all right"
843
+ (two words). Some dictionaries now accept "alright" as
844
+ informal, but formal writing prefers "all right".
845
+ patterns:
846
+ - conditions:
847
+ - type: phrase_check
848
+ wrong_phrase: "alright"
849
+ suggestion: "all right"
850
+ message: '"alright" is non-standard — consider "all right"'
851
+ suggestion: 'all right'