LibreOffice Writer: spell checking of camel-case words

libreofficelibreoffice-writerspell-check

I'm writing a software documentation using LibreOffice Writer. I often refer to class or function names in this documentation. For example ChessBoard or getCell. These are all underscored with red wavy lines and I'm getting a bit annoyed about it.

Is there an option or add-on that I can turn on so LO would recognize that a capital letter in the middle of the word is a clue that it is a camel-case expression so it should be spell-checked part by part, not all at once?

Best Answer

I don't think that an option or an add-on exists for the spell-checking of camel-case words, but I can offer the following workaround.

The idea is to encode the documentation file in Unicode (such as UTF-8) and to insert a Zero-width joiner character between the words. This weird character is defined as:

The zero-width joiner (ZWJ) is a non-printing character used in the computerized typesetting of some complex scripts such as the Arabic script or any Indic script. When placed between two characters that would otherwise not be connected, a ZWJ causes them to be printed in their connected forms.

The character's code point is U+200D ZERO WIDTH JOINER (HTML ‍ ‍).

The insertion of the character can easily be done by a simple regex substitution. It can also be inserted by typing Ctrl + Shift + U +200D.

If this idea works, each word will be separately spell-checked, but the two words will always be printed as attached with no space or line-break in-between. However, I don't use LibreOffice Writer and cannot test the idea.

Edit by fixer1234: I tested this in LO Writer v6.0 and can confirm that it works. Also, the capitalized camelcase component words are not viewed by LO as capitalization errors (the capitalization is ignored).

For more information about such characters, see the article
The Beauty of Unicode: Zero-Width Characters.

Related Question