TexMaker
(或其分叉等效项:)TexStudio
有一个词典选项,可在编辑器中提供拼写功能。但是,正如问题中提到的将单词添加到 TexMaker 词典中?,没有直接的方法将额外和自定义单词添加到其词典中。这是一个重要的功能,特别是对于那些在特定科学或技术领域工作且有不常见单词的人来说。似乎将额外单词添加到词典文件的唯一方法是编辑它们(词典文件可以在的安装文件夹中找到TexMaker
)。此外,似乎TexMaker
使用标准OpenOffice
(Hunspell,
如 Tim Hoffmann 所述)词典。
问题是这些词典中的单词后面有一些代码,这些代码显然有助于跳过添加词根变体。例如,对于单词book
,我们有book/SBJGMD
。这些代码显然是在主词典 (.dic) 文件附带的词缀 (.aff) 文件中定义的。但是,我在词缀文件中找不到它们含义的任何描述。我需要这些信息,因为我想在词典中添加一些额外的单词供自己使用,而无需添加它们的所有变体。
是否有关于词缀文件中使用的代码或语法的参考?
答案1
我找到了关于此的描述网页。为了完整性,下面提供了那里描述的语法的副本:
Here is an example of how to define one specific suffix borrowed
from the en_US.aff file used by the OpenOffice org spellchecker
SFX D Y 4
SFX D y ied [^aeiou]y
The first line has 4 fields:
Field
-----
1 SFX - indicates this is a suffix
2 D - is the name of the character which represents this suffix
3 Y - indicates it can be combined with prefixes (cross product)
4 4 - indicates that sequence of 4 affix entries are needed to
properly store the affix information
The remaining lines describe the unique information for the 4 affix
entries that make up this affix. Each line can be interpreted
as follows: (note fields 1 and 2 are used as a check against line 1 info)
Field
-----
1 SFX - indicates this is a suffix
2 D - is the name of the character which represents this affix
3 y - the string of chars to strip off before adding affix
(a 0 here indicates the NULL string)
4 ied - the string of affix characters to add
(a 0 here indicates the NULL string)
5 [^aeiou]y - the conditions which must be met before the affix
can be applied