using a thesaurus via php (or other language on a server)?

i've been thinking about extending the 'related items' plugin to include a thesaurus lookup for the tags (so that the related list would be larger and still include relevant items).

i found an api service that can do this - however it runs one word at a time and so each page load may be very slow when the tag list of the current elgg item is more than 1 tag.

i thought about using open office's thesaurus on the server and found that there is an api for doing that..
i haven't tested it at all.. i am wondering if anyone here has done anything like this before and maybe has some tips/weblinks?

thanks