2

I write from time to time: tales, short novels, etc. Everything in Spanish (I'm not very fluent in English). And I use Emacs since long time ago for everything I write (not only Literature related texts, but for programming, task management, etc.).

I would like to set up a synonyms service to be used from inside Emacs. And I needed for Spanish. I know there are some very good ones for English, but I couldn't find anything for Spanish. Is there anyone that knows one of this services, and how to set them up with one of the already known Emacs packages?

An alternative would be to try to find such a service with a REST API, and try to set up some functions to request synonyms for the word at point to this service using the REST interface. I'm an experienced programmer, but not with Emacs Lisp, and I don't know if this is two much for me. Any hints on libraries of ways to do this, if an already existing solution is not available?

Drew
  • 75,699
  • 9
  • 109
  • 225
J C Gonzalez
  • 365
  • 4
  • 9

2 Answers2

2

You can use www-synonyms.el which is available from melpa. It takes altervista as source.

Although it's functional and supports spanish, as well as a couple of other languages other than english, UI can use some help. Personally, I miss something able to work locally as spell checkers do.

Muihlinn
  • 2,576
  • 1
  • 14
  • 22
1

Following the suggestion of Muihlinn I used www-synonyms.el, and it works quite well. You have to log onto altervista to get the key that you have to include in your set up (you can do it with a Google account).

Then, I put in my init.el (or .emacs):

;;;---{{{ Sinonimos }}}-------------------------
(require 'www-synonyms)

;; Get key here: http://thesaurus.altervista.org/mykey
(setq www-synonyms-key "<my-key>")

;; any of: it, fr, de, en, el, es, no, pt, ro, ru, sk
(setq www-synonyms-lang "es_ES")

;; Set C-x w as key binding to insert a synonym of the word at place
(global-set-key (kbd "\C-x w") 'www-synonyms-insert-synonym)

Some remarks: I put es_ES, instead of es, since this is the key of the mapping in the code. In addition, I have set Control-x w as the keybinding to call the function to show the possible synonyms of a given word.

Also, with my Emacs version and setup, and my OS, I had to add the following at the beginning of the www-synonyms.el code file (and re-byte-compile the file):

(require 'cl-extra)

and change a call to mapcan to cl-mapcan; otherwise I get an error on mapcan.

It works like a charm!

Example of call to function www-synonyms-insert-synonym

J C Gonzalez
  • 365
  • 4
  • 9