Ask Your Question
1

Spell check from the command line - is it possible?

asked 2016-10-28 01:16:27 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Is it possible to use the algorithms and dictionaries of LibreOffice to spell a txt (plain text) file from the command line?

The question has been asked before at:

https://ask.libreoffice.org/en/question/1639/commandline-spellcheck-with-libreoffice-dictionary/

but the answer in there (accepted by Alex Kemp) is incorrect - they point to the use of Huspell which may use the same algorithm, but not the same dictionaries. Take for example, Vero, for the Portuguese language:

 https://pt-br.libreoffice.org/projetos/vero/

it has its own dictionary which is different from Hunspell.

edit retag flag offensive close merge delete

Comments

I think, you should better ask the developers of Vero if they provide any option for command line.

gabix gravatar imagegabix ( 2016-10-28 13:01:22 +0200 )edit

Hunspell is a program that uses dictionary files that have to be built according to a set of rules. Lots of those dictionary files have been put together by people not associated with the developers of Hunspell. So, you can replace the dictionary supplied with Hunspell by one you made yourself or by the one that came with Vero, provided that it was built with the rules set by Hunspell. If Vero is based on Myspell, you can expect problems.

floris v gravatar imagefloris v ( 2016-10-29 11:02:43 +0200 )edit

@gabix, Vero is just an example that shows that Alex Kemp accepted the wrong answer for the previous question. I am interested in this question in the most generic form - that is - for any dictionary installed on LibreOffice.

pauloney gravatar imagepauloney ( 2016-10-29 22:21:36 +0200 )edit

On second thoughts: how is this related to LibreOffice?

floris v gravatar imagefloris v ( 2016-10-30 21:27:28 +0200 )edit

@floris_v: it's obvious he wants to leverage LO to spellcheck another file without starting LO.

rautamiekka gravatar imagerautamiekka ( 2016-10-30 21:36:53 +0200 )edit

Spell checking is an interactive process, so you need some kind of interface. Either use Libre, or the interface provided by Hunspell, which is a program developed independently from Libre. So - download a Hunspell executable, and any dictionaries you want to use with it, read the documentation of Hunspell so you know how to add the dictionaries and go for it.

floris v gravatar imagefloris v ( 2016-10-30 22:02:16 +0200 )edit

He said Hunspell doesn't understand LO's dicts.

rautamiekka gravatar imagerautamiekka ( 2016-10-30 22:05:59 +0200 )edit

He's vague about that - all he says is that the dictionaries are different, not that Hunspell can't understand them.

floris v gravatar imagefloris v ( 2016-10-30 22:50:25 +0200 )edit

He says, word for word, Hunspell might use same algo but not same dictionaries.

rautamiekka gravatar imagerautamiekka ( 2016-10-30 22:52:16 +0200 )edit

Downloaded Vero - it's a set of dictionary and hyphenation files, If hunspell doesn't recognize it, it would be unusable in LibreOffice. Btw, it's not been updated for over a year. Your last comment makes no sense - if hunspell can't deal with the dictionaries that come with Libre, you'd get a tsunami of complaints about the spell checker not working.

floris v gravatar imagefloris v ( 2016-10-30 22:56:44 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-10-30 23:55:58 +0200

floris v gravatar image

Hunspell is a spell checking program developed by a Hungarian programmer. Anyone can build dictionary files for it for any language.

Vero is a set of dictionary files for use with Hunspell, and maybe Aspell or Myspell as well, and hyphenation rules. You can't use it as a stand-alone program, because it isn't a program like Hunspell. To answer your question: it uses the rules defined in Hunspell, but it will have other words and the like in its dictionary than the dictionary set that comes with LibreOffice by default.

So, download a Hunspell executable for Windows, park it on your computer (you don't have to install it like you'd do with other software), read the documentation to learn to work with it and to find out how and where to put dictionary files, then run it from the command line. I'm not sure if you can use it to parse text files, you will need some interface for dealing with unrecognized or misspelled words anyway, don't expect that it will resolve errors automatically, it won't.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2016-10-28 01:16:27 +0200

Seen: 527 times

Last updated: Oct 30 '16