linux - 向 aspell 添加许多词典

标签 linux terminal aspell

我有一个包含多个文件的 tex 文档,我想用 aspell 检查它。 我使用的命令是:

cat $f | aspell list --extra-dicts="./names.spl" --mode=tex -l en |sort -u

对于每个文件名f。

一些与发音有关的文件中有像 aj 和 oo 这样的“单词”,其中 aspell 算作拼写错误。我想过滤掉它们而不将它们放入 names.spl 字典中。 (首先因为它们不是名字,其次因为它们不应该在其他文件中被忽略)

the aspell documentation指出“extra-dicts”参数可以接收一个列表,但我似乎无法正确界定它。我试过 , : 和纯空格无济于事。它们要么被视为长文件路径,要么与 extra-dicts 关键字完全分开。

我也尝试使用该选项两次,但第二次只是覆盖了第一次。

我是否遗漏了一些关于如何在终端中将列表作为命令行参数提供的琐碎信息?

最佳答案

根据texinfo手册(info aspell),aspell使用了一种不同于其他GNU程序的列表选项格式,其中基本选项名称以add-rem- 分别从列表中添加或删除项目:

4.1.1.3 List options ....................

To add a value to the list, prefix the option name with an 'add-' and then specify the value to add. For example, to add the URL filter use '--add-filter url'. To remove a value from a list option, prefix the option name with a 'rem-' and then specify the value to remove. For example, to remove the URL filter use '--rem-filter url'. To remove all items from a list prefix the option name with a 'clear-' without specify any value. For example, to remove all filters use '--clear-filter'.

按照 --extra-dicts 选项的这种模式,您可以添加多个额外的词典作为

--add-extra-dicts dict1 --add-extra-dicts dict2

Aspell 0.60.7-20110707 的文档还提到了一种(可能更新的)更直接的分隔列表格式,使用第三个前缀 lset:

A list option can also be set directly, in which case it will be set to a single value. To directly set a list option to multiple values prefix the option name with a 'lset-' and separate each value with a ':'. For example, to use the URL and TeX filter use '--lset-filter url:tex'.

按照这种格式,您的选项将变为

--lset-extra-dicts dict1:dict2

关于linux - 向 aspell 添加许多词典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50816864/

相关文章:

linux - 一个 Shell 脚本,用于在一个步骤中以文件夹名称作为参数查找并 cd 到文件夹中

bash - 对每一行进行拼写检查

php - 权限被拒绝在本地运行我的项目 Zend Framework

windows - 使用 Windows 终端的 Cmder 颜色错误

android - 在 Android 中使用现有的 ".so"文件(在 Linux 上创建)

bash - 管道导出命令

Perl 与 Aspell 的接口(interface)

linux - 更改vsftp端口

java - Quartz Scheduler 测试场景不工作