在 Vim 中进行拼写检查之前预处理单词

发布于 2024-09-08 00:33:30 字数 467 浏览 1 评论 0原文

我使用 Vim 的拼写检查来验证俄语文本。我们的字母表中有字母 ё,它通常被简单的 е 替换。例如,单词 ёжик из 写作 ежик。实际上这是一个不好的语气。这就像在需要 — (em-dash) 的地方使用 - (连字符),就像使用“计算机”引号忘记了“印刷”《引号》的存在等。

坏处是 Vim 的拼写词典是由简化的单词组成的将所有 ё 替换为 е。所以我总是在 ё 的单词中出现错误。

所以问题是,是否有任何我可以使用的钩子可以让我在拼写检查之前对单词进行规范化?或者也许有人有更好的主意?谢谢。

更新

根据@sarnold的提示,我找到了解决方案。如果他想要 ёёёёё ,应该使用 ru_yo locale 而不是 ru_ru

I use Vim's spell checking to validate texts in Russian. We have letter ё in our alphabet which is often replaced with simple е. So, for example, word ёжик из written as ежик. It is a bad tone actually. Its like using - (hyphen) where — (em-dash) is required, like using "computer" quotes forgetting about existence of „typographic” «quotes», etc.

The bad thing is that spell dictionary for Vim composed out of simplified words with all ёs, replaced with еs. So I always get an error in a word with ё.

So the question, is there any hook I can use that will allow me to normalize a word just before it will be spell checked? Or maybe someone has a better idea? Thanks.

UPDATE

With the hint from @sarnold, I found the solution. One should use ru_yo locale instead of ru_ru if he wants ёёёёё

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹏雨一样淡蓝的深情 2024-09-15 00:33:30

阅读您的文章时,我的第一个想法是建议使用 zg 将单词添加到拼写文件中;几周后你就会得到很多。不理想,但很简单。

:helppell- Russian 列出了几种不同的拼写变体,其中之一有帮助吗?

我还注意到 :helppell.txt 中提供了从 OpenOffice 或 下载您自己的拼写文件的选项http://www.aap.org 自动构建拼写文件。

My first thought when reading your post was to suggest using zg to add the word to the spellfile; after a few weeks you'll have a lot of them. Not ideal, but simple.

:help spell-russian lists several different spelling variations, would one of these help?

I also notice in :help spell.txt that there are options for downloading your own spellfiles from OpenOffice or http://www.a-a-p.org to automate building spellfiles.

星軌x 2024-09-15 00:33:30

我建议您使用自己的 vim 拼写检查。使用方法 #2 在这里解释

I would recommend you to use your own spell checking for vim. Use a method #2 explained here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文