开发者

Replacing a word by synonyms in Haskell

开发者 https://www.devze.com 2023-04-10 22:11 出处:网络
I was going through this plagiarism detector and trying to write a program in Haskell which will read a file and replace some of its words with synonyms. Is there any dictionary available for this pur

I was going through this plagiarism detector and trying to write a program in Haskell which will read a file and replace some of its words with synonyms. Is there any dictionary available for this purpose in Haskell?

Also, if you have any input regarding algorithm or any other input relevant for this problem, like how to avoid changing the context of a statement by replacing a word by its synonyms, then please post it.开发者_高级运维


is there any dictionary available for this purpose in Haskell?

I would imagine that what you are looking for is a plain text file, something like this:

word1: word1synonym1, word1synonym2, ...
word2: word2synonym1, ...
...

In which case it wouldn't really be Haskell-specific. I'm unaware of any free text-file thesauruses like this, though I imagine if you dig around LibreOffice you would probably find one.

how to avoid changing the context of a statement by replacing a word by its synonyms

This is very hard for a computer to do, afaik. I would suggest not expending much effort working on this aspect of it.

any input regarding algorithm

You may find the concept of edit distance useful for this problem. See Approximate string matching and Wagner-Fischer algorithm.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号