[R] extracting text from wordnet using synonym()

Kelvin Lam lamkelf at gmail.com
Sun Aug 16 04:08:56 CEST 2009


Thank you both!  It works now.  (Need to check out the parsing .... )


Gabor Grothendieck wrote:
> 
> Or a variation:
> 
>> unlist(lapply(parse(text = Str), eval))
> [1] "aid"        "assist"     "assistance" "help"       "aid"
> [6] "assistance" "help"
> 
> On Sat, Aug 15, 2009 at 5:55 PM, Henrique Dallazuanna<wwwhsd at gmail.com>
> wrote:
>> Try this:
>>
>> Str <- c("c(\"aid\", \"assist\", \"assistance\", \"help\")",
>>         "c(\"aid\", \"assistance\", \"help\")")
>> unlist(sapply(Str, function(x)dget(textConnection(x)), USE.NAMES =
>> FALSE))
>>
>> On Sat, Aug 15, 2009 at 6:33 PM, Kelvin Lam <lamkelf at gmail.com> wrote:
>>
>>>
>>> Dear group,
>>>
>>> There are postings on extracting partial string using
>>> sub()/gsub()/gsubfn()
>>> but I still couldn't figure this one out.  Supposed I am pulling the
>>> synonyms of "help" using synonyms("help") from wordnet and get the
>>> followings:
>>>
>>> > synonyms("help")
>>> [1] "c(\"aid\", \"assist\", \"assistance\", \"help\")"
>>> [2] "c(\"aid\", \"assistance\", \"help\")"
>>>
>>> How can I get a one character string at the end that looks like this:
>>>
>>> [1] "aid" "assist" "assistance" "help" "aid" "assist" "help"
>>>
>>> Thanks for the help!!!!!
>>>
>>> Kelvin
>>> --
>>> View this message in context:
>>> http://www.nabble.com/extracting-text-from-wordnet-using-synonym%28%29-tp24988275p24988275.html
>>> Sent from the R help mailing list archive at Nabble.com.
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>>
>>
>> --
>> Henrique Dallazuanna
>> Curitiba-Paraná-Brasil
>> 25° 25' 40" S 49° 16' 22" O
>>
>>        [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/extracting-text-from-wordnet-using-synonym%28%29-tp24988275p24989814.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list