アットウィキロゴ

らんきんg

import java.io.*;

public class rank{

int s,sx,datanumber,articlenumber;
String[] data=new String[50000];
String[] dic=new String[50000];  
int[][] nword=new int[5000][5000];
int[] wordnumber=new int[5000];
int[] num=new int[50000];
int[] rank=new int[2000];
int[] ch=new int[50000];
int p;
int xlong,h,dicnumber;
String file;
int n,sxs,maxn;

public static void main(String[] args){
rank test=new rank();
}

rank(){        

readfile("lib.txt");

for(s=1;s<datanumber+1;s++){
dic[s]=data[s];
}

dicnumber=datanumber;

for(n=1;n<900;n++){

file="ndata/";
file=file+n;
file=file+".txt";

readfile(file);

articlenumber=datanumber;

for(s=1;s<datanumber+1;s++){
String[] x=data[s].split(",");
xlong=x.length;
wordnumber[s]=xlong;
for(sx=1;sx<xlong+1;sx++){
nword[s][sx]=Integer.parseInt(x[sx-1]);
}
}


for(s=1;s<datanumber+1;s++){
xlong=wordnumber[s];
for(sx=1;sx<xlong+1;sx++){
p=nword[s][sx];
if(p>0)num[p]=num[p]+1;
}
}

}









}


void readfile(String file){

String str;
BufferedReader br;
int s;
s=0;

try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"SJIS"));  
while((str = br.readLine()) != null) {  
s=s+1;
data[s]=str;  
}
br.close();
} catch (IOException e) {System.out.println(e);}
datanumber=s;

}








}
最終更新:2011年06月14日 03:24