emacs - 使用 ispell/aspell 拼写检查驼峰式单词

标签 emacs aspell camelcasing ispell

我需要拼写检查包含许多驼峰单词的大型文档。我想要 ispell 或 aspell 检查单个单词是否拼写正确。

所以,如果是这个词:

ScientificProgrezGoesBoink



我很想让它建议这个:

ScientificProgressGoesBoink



有没有办法做到这一点? (我的意思是,在 Emacs 缓冲区上运行它时。)请注意,我不一定希望它提出完整的替代方案。但是,如果它知道 Progrez 未被识别,我希望能够至少替换该部分,或者将该词添加到我的私有(private)词典中,而不是将每个 Camel 大写的词都包含在词典中。

最佳答案

我接受了@phils 的建议,并深入挖掘了一些。事实证明,如果你得到 camelCase-mode并像这样重新配置一些 ispell:

(defun ispell-get-word (following)
  (when following
    (camelCase-forward-word 1))
  (let* ((start (progn (camelCase-backward-word 1)
                       (point)))
         (end (progn (camelCase-forward-word 1)
                     (point))))
    (list (buffer-substring-no-properties start end)
          start end)))

然后,在这种情况下,单个驼峰式单词,例如 AsThisOne,实际上将被正确地进行拼写检查。 (除非你在文档的开头——我刚刚发现。)

所以这显然不是完整的解决方案,但至少它是一些东西。

关于emacs - 使用 ispell/aspell 拼写检查驼峰式单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3554448/

相关文章:

Emacs:确定文件中的位置

python - aspell-python 安装错误

emacs - 如何在 OSX 上使用 GNU Emacs 拼写检查来查找用户的个人词典?

gnu - 如何从阿斯佩尔的英语词典中删除单词

启动时 Emacs 自动完成模式

c++ - emacs 注释缩进 Qt 风格

javascript - npm 风格的 Emacs JS 模式

c# - System.Text.Json 不会驼峰化动态属性的属性

google-sheets - 如何在 Google 电子表格公式中将字符串转换为驼峰式大小写

PascalCased 单词的正则表达式(又名驼峰式大写字母)