在 Vim 中进行拼写检查之前预处理单词
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
阅读您的文章时,我的第一个想法是建议使用 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.我建议您使用自己的 vim 拼写检查。使用方法 #2 在这里解释
I would recommend you to use your own spell checking for vim. Use a method #2 explained here