import java.io.IOException;
import java.util.List;
import net.reduls.igo.Morpheme;
import net.reduls.igo.Tagger;
public class pro{
int s,wordnumber;
String[] word=new String[100];
String str;
public static void main(String[] args){
pro test=new pro();
}
pro(){
str="菅総理大臣は、東日本大震災から3カ月の11日に被災地を訪れて続投に意欲を見せましたが、仙谷官房副長官は「頑張るのは本人にとっても良くない」と述べ、早期退陣を促しました。";
try {
Tagger tagger = new Tagger( "ipadic" );
List<Morpheme> list = tagger.parse(str);
s=0;
for(Morpheme morph : list ){
s=s+1;
word[s]=morph.surface;
}
} catch(IOException e) {
System.err.println(e.getMessage());
}
wordnumber=s;
for(s=1;s<wordnumber+1;s++){
System.out.println(word[s]);
}
}
}
最終更新:2011年06月11日 19:30