[R] help in sentDetect() fuction

raishilpa raishilpa.bhu at gmail.com
Fri Jun 15 08:48:07 CEST 2012


hello,
I am using the following code

>s<-"I am very happy, excited, and optimistic.I am very scared, annoyed, and
irritated.Iraq’s political crisis entered its second week one step closer to
the potential.dissolution of the government, with a call for elections by a
vital coalition partner and a suicide attack that extended the spate of
violence. that has followed the withdrawal.of U.S. troops"

> sentDetect(s, language = "en")
#getting output in the following way

[1] "I am very happy, excited, and optimistic.I am very scared, annoyed, and
irritated.Iraq’s "                                           
[2] "political crisis entered its second week one step closer to the
potential.dissolution "                                              
[3] "of the government, with a call for elections by a vital coalition
partner and a suicide attack that extended the spate of violence. "
[4] "that has followed the withdrawal.of "                                                                                                
[5] "U.S. troops"     

I want output in some different way...since sentences [1] [2] [3] [4] [5]
are from " s" I want output in following way

[1] -"I am very happy, excited, and optimistic.I am very scared, annoyed,
and irritated.Iraq’s political crisis entered its second week one step
closer to the potential.dissolution of the government, with a call for
elections by a vital coalition partner and a suicide attack that extended
the spate of violence. that has followed the withdrawal.of U.S. troops"
[1,1]  "I am very happy, excited, and optimistic.I am very scared, annoyed,
and irritated.Iraq’s "         
[1,2]  "political crisis entered its second week one step closer to the
potential.dissolution " 
[1,3] "of the government, with a call for elections by a vital coalition
partner and a suicide attack that extended the spate of violence. "
[1,4] "that has followed the withdrawal.of "
[1,5] "U.S. troops" 

or in some other way that you guys can suggest me...but remember one thing-
under the main paragraph all the sentences should come so that it become
easy to recognize the parent para of the sub-sentences.

thanking you in anticipation
Shilpa Rai
MSc IIT Bombay
.





--
View this message in context: http://r.789695.n4.nabble.com/help-in-sentDetect-fuction-tp4633462.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list