アットウィキロゴ

練習lk

import java.io.*;

class person{

int s,sx,p1,h;
String data,data1;
int[] point=new int[10000];
String[] person=new String[100000];
String[] cr1=new String[1000];
String[] cr2=new String[1000];
String file;
int page;
int xlong,slong;
String x1,x2,str1;
int cnumber,pnumber;

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

person(){

page=5010;

file="data/";
file=file+page;
file=file+".txt";

System.out.println(file);

readfile(file);

p1=data.indexOf("○");

if(p1>0)data1=data.substring(0,p1);

String[] x=data1.split("<BR>");

xlong=x.length;


sx=0;
for(s=1;s<xlong;s++){
h=0;
x1="";
slong=x[s].length();
if(slong>1)x1=x[s].substring(slong-1,slong);
if(x1.equals("君"))h=100;
if(h>50)sx=sx+1;
if(h>50)cr1[sx]=x[s];
}
cnumber=sx;

sx=0;
for(s=1;s<cnumber+1;s++){
h=0;
if(cr1[s].indexOf("請願")>1)h=100;
if(cr1[s].indexOf("法律案")>1)h=100;
if(cr1[s].indexOf("法案")>1)h=100;
if(cr1[s].indexOf("補欠")>1)h=100;
if(cr1[s].indexOf("及び")>1)h=100;
if(h<50)sx=sx+1;
if(h<50)cr2[sx]=cr1[s];
}

cnumber=sx;

str1=")";

pnumber=sx;
for(s=1;s<pnumber+1;s++){
cr2[s]=cr2[s].replace(" ","△");
cr2[s]=cr2[s].replace(" ","△");
cr2[s]=cr2[s].replace("委員長代理","△");
cr2[s]=cr2[s].replace("委員長","△");
cr2[s]=cr2[s].replace("理事","△△");

}

str1=")";

for(s=1;s<pnumber+1;s++){
h=0;
if(cr2[s].indexOf("君△")>1)h=100;
if(h<50)cr2[s]=cr2[s].replace("△","");
p1=cr2[s].indexOf(str1);
if(p1>0)cr2[s]=cr2[s].substring(p1+2,cr2[s].length());
System.out.println(cr2[s]);
}


for(s=1;s<pnumber+1;s++){
h=0;
if(cr2[s].indexOf("君△")>1)h=100;
String[] xx=cr2[s].split("君△");
if(h>50)xx[1]=xx[1].replace("△","");
if(h>50)System.out.println(xx[1]);
if(h>50)xx[0]=xx[0].replace("△","");
if(h>50)System.out.println(xx[0]);
}





}



void readfile(String file){

String str;
BufferedReader br;  

data="";

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

}


}
最終更新:2011年06月28日 13:39