import java.io.*;
class game{
int s,n,p1,datanumber;
String str;
String a[]=new String[1000];
public static void main(String [] args) {
game test=new game();
}
game(){
csvdata();
for (s=1;s<datanumber+1;s++){
System.out.println(makeword(a[s]));
}
}
String makeword(String word){
String[] str=new String[100];
int mx,m,sx,p1,px,minx;
String z1;
str[1]="動詞";
str[2]="形容詞";
str[3]="形容動詞";
str[4]="名詞";
str[5]="代名詞";
str[6]="連体詞";
str[7]="副詞";
str[8]="接続詞";
str[9]="感動詞";
str[10]="付属語";
str[11]="助動詞";
str[12]="助詞";
str[13]="記号";
str[14]="未知語";
str[15]="フィラー";
str[16]="接頭詞";
minx=9999;
for(m=1;m<17;m++){
px=word.indexOf(str[m]);
if(px<0)px=9999;
if(px<minx)minx=px;
}
z1="";
if(minx<500)z1=word.substring(0,minx);
return z1;
}
int check(String word){
String[] str=new String[100];
int h,m;
str[1]="動詞";
str[2]="形容詞";
str[3]="形容動詞";
str[4]="名詞";
str[5]="代名詞";
str[6]="連体詞";
str[7]="副詞";
str[8]="接続詞";
str[9]="感動詞";
str[10]="付属語";
str[11]="助動詞";
str[12]="助詞";
str[13]="記号";
str[14]="未知語";
str[15]="フィラー";
str[16]="接頭詞";
h=0;
for(m=1;m<17;m++){
if(word.indexOf(str[m])>-1)h=100;
}
return h;
}
void csvdata(){
n=0;
try {
FileReader fr = new FileReader("a825.txt");
BufferedReader br = new BufferedReader(fr);
while((str = br.readLine()) != null) {
n=n+1;
a[n]=str;
}
fr.close();
} catch (IOException e) {System.out.println(e);}
datanumber=n;
}
}
最終更新:2011年04月22日 22:21