Thesaurus - other languages than english

Everything related to our flagship word processor.
Post Reply
pereelmagne
Posts: 13
Joined: 2015-06-27 01:38:22

Thesaurus - other languages than english

Post by pereelmagne »

I've recently installed the spelling and hyphenation Catalan dictionaries, which are good, constantly updated. It'd be nice to be able to do the same with the thesaurus files.

If this was possible, maybe the thesaurus files from the LibreOffice installation would work. I've found them in the installation package ("th_ca_ES_v3.dat" and "th_ca_ES_v3.idx"). In LO Writer, the thesaurus is invoked by the simple Cmd F7 shortcut.

Please, if anyone reads this, I would appreciate very much a hint as to this being possible or not.

Best wishes to everybody,

Pere
adryan
Posts: 563
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Thesaurus - other languages than english

Post by adryan »

G’day, Pere et al

You can copy those thesaurus files to a convenient location and then rename them. If permissions are a problem, you can copy their contents and paste them into a new Nisus document.

What follows is a simple macro that could be invoked with a keyboard shortcut. Alter folder paths and filenames in the macro as appropriate. The .txt file in the macro is derived from a (German) .dat file rather than a .idx file. I won’t bother to elaborate here on the syntax of the .dat files, but the macro could be adapted if desired to make entries a little easier on the eye. It could also be enhanced to allow you to select a particular synonym and have it replace the original word or expression in your main document. I have not bothered to incorporate error checking, but you should be aware that the macro only finds index words. It will find synonyms for “gut”, for example, but not for “guten”.

Code: Select all

#NisusMacroProperty Name: Thesaurus

# This macro gets a selected word or expression in the active document and finds synonyms for it in the designated thesaurus file.

$thesaurus_folder = 'Documents/Thesaurus/'
$path_to_thesaurus_folder = '~/' & $thesaurus_folder
$German_thesaurus = 'Thesaurus DE.txt'
$current_thesaurus = $German_thesaurus
$path_to_current_thesaurus = $path_to_thesaurus_folder & $current_thesaurus

Copy
$keyword = Read Clipboard

Open $path_to_current_thesaurus
Find All @Text<^$keyword\|.+\n(-.+\n)+>, 'Ea'
I hope this indicates one path you may care to follow. Any further discussion of macros should really be conducted in the Macros forum, though.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
adryan
Posts: 563
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Thesaurus - other languages than english

Post by adryan »

G’day, Pere et al

I see there is a discussion on Writing in Multiple Languages in the Nisus Writer Pro User Guide. It specifically mentions LibreOffice dictionaries, but I haven’t yet experimented to see how easy it all is in operation. No doubt other multilinguists on the forum will have done so.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
pereelmagne
Posts: 13
Joined: 2015-06-27 01:38:22

Re: Thesaurus - other languages than english

Post by pereelmagne »

Thanks a lot, Adryan. I will what you suggested.

Best wishes,

Pere
Post Reply