package movie;
import java.io.*;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[360000];
String[] namex=new String[5000000];
String[] name=new String[500000];
int[] year=new int[5000000];
int[] month=new int[5000000];
int[] day=new int[5000000];
String[] th=new String[5000000];
String[] v1=new String[5000000];
String[] v2=new String[5000000];
String[] v3=new String[5000000];
String[] time=new String[5000000];
String[] code=new String[50000];
String[] code_name=new String[50000];
String[] dic_id=new String[50000];
String[] id_name=new String[50000];
String[] id=new String[50000];
String[] gid_name=new String[50000];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
readx("ren.txt");
int sx=1;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split("△");
if(x.length==7){
String pp=x[1].substring(6,8);
sx=sx+1;
name[sx]=x[6];
namex[sx]=name[sx];
year[sx]=2017;
month[sx]=3;
day[sx]=numx(pp);
th[sx]=x[0];
v1[sx]=x[3];
v2[sx]=x[4];
v3[sx]=x[5];
time[sx]=x[2];
}
}
datanumber=sx;
for(s=2;s<datanumber+1;s++){
System.out.println(namex[s]);
int p1=namex[s].indexOf("(");
if(p1>0)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("(");
if(p1>0)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("(");
if(p1>0)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("(");
if(p1>0)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("[");
if(p1>0)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("【");
if(p1>0)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("(");
if(p1>5)namex[s]=namex[s].substring(0,p1);
p1=namex[s].indexOf("(");
int p2=namex[s].indexOf(")",p1);
if(p1==0)namex[s]=namex[s].substring(p2+1,namex[s].length());
namex[s]=namex[s].replace("(字幕版)","");
namex[s]=namex[s].replace("(日本語吹替版)","");
namex[s]=namex[s].replace("(3D・字幕版)","");
namex[s]=namex[s].replace("3D字幕IMAX","");
namex[s]=namex[s].replace("(3D・日本語吹替版)","");
namex[s]=namex[s].replace("<4Kデジタル復元版>","");
namex[s]=namex[s].replace("トークショー付上映","");
namex[s]=namex[s].replace("≪応援上映≫","");
namex[s]=namex[s].replace("3D4DX","");
namex[s]=namex[s].replace("3D","");
namex[s]=namex[s].replace("[舞台挨拶中継]","");
namex[s]=namex[s].replace("[中継]","");
namex[s]=namex[s].replace("吹替","");
namex[s]=namex[s].replace("イベント付上映","");
namex[s]=namex[s].replace("【舞台挨拶中継付先行】","");
namex[s]=namex[s].replace("[舞台挨拶中継先行/]","");
namex[s]=namex[s].replace("【字幕2D】","");
namex[s]=namex[s].replace("【字幕】","");
namex[s]=namex[s].replace("【字幕付】","");
namex[s]=namex[s].replace("【】","");
namex[s]=namex[s].replace("【舞台挨拶付先行上映会】","");
namex[s]=namex[s].replace("【イベント】","");
namex[s]=namex[s].replace("【舞台挨拶付】","");
namex[s]=namex[s].replace("4DX","");
namex[s]=namex[s].replace("【2D・日本語字幕付】","");
namex[s]=namex[s].replace("[初日舞台挨拶]","");
namex[s]=namex[s].replace("【公開記念舞台挨拶】","");
namex[s]=namex[s].replace("【大ヒット舞台挨拶】","");
namex[s]=namex[s].replace("【字幕HFR】","");
namex[s]=namex[s].replace("(イベント上映)","");
namex[s]=namex[s].replace("【握手会付】","");
namex[s]=namex[s].replace("【冬休み直前舞台挨拶】","");
namex[s]=namex[s].replace("【舞台挨拶先行】","");
namex[s]=namex[s].replace("プレミア先行上映","");
namex[s]=namex[s].replace("2D","");
namex[s]=namex[s].replace("プレミア先行上映","");
namex[s]=namex[s].replace("ATMOS","");
namex[s]=namex[s].replace("字幕","");
namex[s]=namex[s].replace("(吹替版)","");
namex[s]=namex[s].replace("(字幕版)","");
namex[s]=namex[s].replace("(3D・吹替版)","");
namex[s]=namex[s].replace("(3D・字幕版)","");
namex[s]=namex[s].replace("[4DX2D]","");
namex[s]=namex[s].replace("[2D・吹替]","");
namex[s]=namex[s].replace("[2D・字幕]","");
namex[s]=namex[s].replace(" (IMAX)","");
namex[s]=namex[s].replace("(MX4D)","");
namex[s]=namex[s].trim();
}
int dicnumber=0;
String[] dic=new String[50000];
for(s=2;s<datanumber+1;s++){
int h=0;
for(sx=1;sx<dicnumber+1;sx++){
if(namex[s].equals(dic[sx]))h=100;
}
if(h<50)dicnumber=dicnumber+1;
if(h<50)dic[dicnumber]=namex[s];
}
System.out.println(dicnumber);
for(s=1;s<dicnumber+1;s++){
String word=dic[s];
code[s]="";
bing sub5=new bing();
code[s]=sub5.makedata(word);
if(code[s].indexOf("mv")<1){
direct sub55=new direct();
code[s]=sub55.makedata(word);
}
code_name[s]="";
if(code[s].length()>1){
check sub6=new check();
code_name[s]=sub6.makedata(code[s]);
}
wiki sub21=new wiki();
String w1=sub21.makedata(word);
wiki sub22=new wiki();
String w2=sub22.makedata(code_name[s]);
int ch=0;
if(w1.equals(w2))ch=100;
if(word.equals(code_name[s]))ch=100;
dic_id[s]="";
if(ch>50)dic_id[s]=code[s];
System.out.println(s+","+word+","+code_name[s]);
}
for(s=2;s<datanumber+1;s++){
id[s]="";
for(sx=1;sx<dicnumber+1;sx++){
if(namex[s].equals(dic[sx]))id[s]=dic_id[sx];
}
}
writexml("p.csv");
}
void writexml(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
pw.println("y,m,d,t,th,n,v1,v2,v3,code");
for(s=2;s<datanumber+1;s++){
pw.print(year[s]);
pw.print(",");
pw.print(month[s]);
pw.print(",");
pw.print(day[s]);
pw.print(",");
pw.print(time[s]);
pw.print(",");
pw.print(th[s]);
pw.print(",");
pw.print(name[s]);
pw.print(",");
pw.print(v1[s]);
pw.print(",");
pw.print(v2[s]);
pw.print(",");
pw.print(v3[s]);
pw.print(",");
pw.println(id[s]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
int numx(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
void readx(String file){
String str;
BufferedReader br;
int s;
s=0;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
while((str = br.readLine()) != null) {
s=s+1;
data[s]=str;
}
br.close();
} catch (IOException e) {System.out.println(e);}
datanumber=s;
}
}
最終更新:2017年04月02日 15:58