如何在emacs中拼写检查多种语言? [英] How can I spell check for multiple languages in emacs?

查看:170
本文介绍了如何在emacs中拼写检查多种语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我主要用HTML编写我的文档,使用emacs 作为主编辑器。 Emacs让您以命令 ispell-buffer 交互式拼写检查当前缓冲区。

I write mostly my documentation in HTML using emacs as my main editor. Emacs let you interactively spell-check the current buffer with the command ispell-buffer.

由于我在语言数量,我在文件末尾有一个HTML注释,指定该文件的主要字典和个人字典,例如对于挪威语(norsk),我使用以下对词典:

Since I switch between a number of languages, I have an HTML comment at the end of the file specifying the main dictionary and personal dictionary for that file, E.g. for Norwegian (norsk) I use the following pair of dictionaries:

<!-- Local IspellDict: norsk -->
<!-- Local IspellPersDict: ~/.aspell/personal.dict -->

这非常棒。

有时我会用另一种语言(例如英语)中嵌入挪威文档的段落。示例:

However, sometimes I have a paragraph in another language (e.g. English) embedded in an otherwise Norwegian document. Example:

<p xml:lang="en">This paragraph is in English.</p>

拼写检查器自然地标记所有这样的段落中的单词拼写错误(由于字典中只包含挪威文字)。

The spell-checker naturally flag all the words in such a paragraph as misspellings (since the dictionary only contain Norwegian words).

为避免这种情况,我尝试在文档中添加一个英国字典,如下所示: p>

To avoid this, I've tried to add a "british" dictionary to the document, like this:

<!-- Local IspellDict: british -->
<!-- Local IspellDict: norsk -->
<!-- Local IspellPersDict: ~/.aspell/personal.dict -->

不幸的是,这不行。 英国字典被忽略。

Unfortunately, this does not work. The "british" dictionary is simply ignored.

我最喜欢的解决方案是加载一个额外的字典,并使用这个,与主词典进行拼写检查。这是可能吗?

My prefered solution would to load an additional dictionary and use this, toghether with the primary dictionary, for spell-checking. Is this possible?

但是,我也对一个解决方案感兴趣,让我标记不是的段落被拼写检查。这不是理想的,但它会阻止有效的英语单词被标记为拼写错误。

However, I am also interested in a solution that let me mark paragraphs for not being spell checked. It is not ideal, but it would stop valid English words from being flagged as misspellings.

PS:我也看过这个问题的答案:使用语言检测的多语言拼写检查,但是它更广泛,不能解决具体的使用 emacs ispell 进行拼写检查。

PS: I have also looked at the answer to this question: Multilingual spell checking with language detection, but it is much broader and does not address the specific use emacs ispell for doing the spell-check.

推荐答案

尝试ispell-multi和flyspell-xml-lang http://www.dur.ac.uk/pjheslin/Software/Emacs/

Try ispell-multi and flyspell-xml-lang http://www.dur.ac.uk/p.j.heslin/Software/Emacs/

您可以生成多个ispell实例,并使用xml:lang标签来决定要检查的语言。

You can spawn multiple instances of ispell, and use the xml:lang tag to decide which language to check for.

这篇关于如何在emacs中拼写检查多种语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆