I am currently working on my thesis and implementing the solution in R language. i have to find synonyms using word-net dictionary library. i get the synonyms against single word but when i try to get synonyms using loop for set of words i get the error "Subscription is out of bond".. kindly if some one can guide me how to get synonyms for against each word in text using loop or is there any other way to do it? here is the code i am trying
*my_corpus <- "closure animal wrong carnivore herbivore meat omnivore veg wrong"
for (j in seq(my_corpus))
{
if(initDict()) {
filter <- getTermFilter("ExactMatchFilter", "my_corpus", TRUE)
terms <- getIndexTerms("NOUN", 5, filter)
getSynonyms(terms[[my_corpus]])
}
}
*
replace "my_corpus" with j
put print() around getSynonyms
Try "company" and notice how no businesses ever come up. Synonyms from wordnet package are very incomplete