your-tools / skyspell

Fast and handy spell checker for the command line
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Allow providing multiple languages with --lang #2

Open fenuks opened 1 year ago

fenuks commented 1 year ago

In many projects you can repository may use more than one language. Sometimes other language can be used in one directory (e.g. translated external documentation), and sometimes usage can be mixed (e.g. code is in English, but comments/documentation in other). Currently, it is forbidden to provide multiple languages:

error: The argument '--lang <LANG>' was provided more than once, but cannot be used multiple times

I think that it would be also useful to allow setting this via skyspell-ignore file, otherwise user must know which flags to pass, and it also makes more difficult to write generic CI template for all projects.

dmerejkowsky commented 1 year ago

Currently, it is forbidden to provide multiple languages:

Yes. Unfortunately there's not much we can do here because we are using Enchant and Enchant itself does not have this feature.

Sorry :(

fenuks commented 1 year ago

Well, I don't know inner working of this tool, but couldn't it e.g. load all dictionaries separately and iterate. Let's say I have text in Latin, and I would like to check it for English and Latin. I check first for English, some errors are detected, and then I check for Latin, and so on. If in any of the loaded dictionaries given word is accepted, then it could be considered correct. Or is this algorithm too naive, or perhaps too difficult to implement correctly/in performant manner?

dmerejkowsky commented 1 year ago

You know, I never thought about that naive algorithm :stuck_out_tongue:

perhaps too difficult to implement correctly/in performant manner?

Well, we won't know until we try - let's re-open this issue !

fenuks commented 1 month ago

Enchant now supports multiple dictionaries, support has been added in https://github.com/AbiWord/enchant/pull/383.