アットウィキロゴ

pかd

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];
int type[]=new int[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(){


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;

for(s=1;s<cnumber+1;s++){
if(cr2[s].indexOf("委員長")>1)type[s]=1;
h=0;
if(type[s]==0)h=h+1;
if(cr2[s].length()<15)h=h+1;
if(h==2)type[s]=2;

}

for(s=1;s<cnumber+1;s++){
h=0;
if(type[s]==0)h=h+1;
x1="△";
if(cr2[s].length()>20)x1=cr2[s].substring(11,12);
if(x1.equals("君"))h=h+1;
if(h==2)type[s]=3;
}

for(s=1;s<cnumber+1;s++){
h=0;
if(type[s]==0)h=h+1;
x1="△";
if(cr2[s].length()>20)x1=cr2[s].substring(11,12);
if(x1.equals("君"))h=0;
if(h==1)type[s]=4;
}


for(s=1;s<cnumber+1;s++){
if(type[s]==1)cr2[s]=cr2[s].replace(" ","△");
if(type[s]==1)cr2[s]=cr2[s].replace("委員長","△");
if(type[s]==1)cr2[s]=cr2[s].replace("代理","△");
if(type[s]==1)cr2[s]=cr2[s].replace("△","");
}

for(s=1;s<cnumber+1;s++){
if(type[s]==2)cr2[s]=cr2[s].replace(" ","△");
if(type[s]==2)cr2[s]=cr2[s].replace("理事","△");
if(type[s]==2)cr2[s]=cr2[s].replace("△","");
}

for(s=1;s<cnumber+1;s++){
if(type[s]==3)cr2[s]=cr2[s].replace(" ","△");
if(type[s]==3)cr2[s]=cr2[s].replace("理事","△");
String[] cp=cr2[s].split("君△");
if(type[s]==3)cr2[s]=cp[0];
if(type[s]==3)cr2[s]=cr2[s].replace("△","");
}

for(s=1;s<cnumber+1;s++){
if(type[s]==4)cr2[s]=cr2[s].substring(15,cr2[s].length());
if(type[s]==4)cr2[s]=cr2[s].replace(" ","△");
if(type[s]==4)cr2[s]=cr2[s].replace("△","");
}






for(s=1;s<cnumber+1;s++){
System.out.println(cr2[s]);
}








}



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日 15:09