アットウィキロゴ

xml 議事録

class xml{

int[] x=new int[10000];
int[] y=new int[10000];
String xml[]=new String[10000];
int[] word1=new int[1000];
int[] word2=new int[1000];
String[] surface=new String[1000];
String[] reading=new String[1000];
String[] pos=new String[1000];
int xmlnumber,wordnumber;
int s;
int map1,map2;

void makedata(String str){

xymaker(str);

for(s=1;s<xmlnumber+1;s++){
xml[s]=xmlmaker(s,str);
}

makemap();

makeword();

for(s=1;s<wordnumber+1;s++){
surface[s]=makesurface(s,str);
reading[s]=makereading(s,str);
pos[s]=makepos(s,str);
}




}

String makepos(int s,String str){

int s1,s2,sx,sx1,sx2,p1,p2;
String strx;

sx1=0;
sx2=1;

s1=word1[s];
s2=word2[s];

for(sx=s1;sx<s2;sx++){
if(xml[sx].equals("pos"))sx1=sx;
if(xml[sx].equals("/pos"))sx2=sx;
}

p1=y[sx1];
p2=x[sx2];

strx=str.substring(p1+1,p2);
return strx;

}
String makesurface(int s,String str){

int s1,s2,sx,sx1,sx2,p1,p2;
String strx;

sx1=0;
sx2=1;

s1=word1[s];
s2=word2[s];

for(sx=s1;sx<s2;sx++){
if(xml[sx].equals("surface"))sx1=sx;
if(xml[sx].equals("/surface"))sx2=sx;
}

p1=y[sx1];
p2=x[sx2];

strx=str.substring(p1+1,p2);
return strx;

}

String makereading(int s,String str){

int s1,s2,sx,sx1,sx2,p1,p2;
String strx;

sx1=0;
sx2=1;

s1=word1[s];
s2=word2[s];

for(sx=s1;sx<s2;sx++){
if(xml[sx].equals("reading"))sx1=sx;
if(xml[sx].equals("/reading"))sx2=sx;
}

p1=y[sx1];
p2=x[sx2];

strx=str.substring(p1+1,p2);
return strx;

}

void makeword(){
int s,sx;

sx=0;
for(s=map1;s<map2;s++){
if(xml[s].equals("word"))sx=sx+1;
if(xml[s].equals("word"))word1[sx]=s;
}

wordnumber=sx;

sx=0;
for(s=map1;s<map2;s++){
if(xml[s].equals("/word"))sx=sx+1;
if(xml[s].equals("/word"))word2[sx]=s;
}

}


void makemap(){
map1=1;
map2=2;
for(s=1;s<xmlnumber+1;s++){
if(xml[s].equals("ma_result"))map1=s;
if(xml[s].equals("/ma_result"))map2=s;
}

}

String xmlmaker(int s,String str){
int p1,p2;
String bara;
p1=x[s];
p2=y[s];
bara=str.substring(p1+1,p2);
return bara;
}

void xymaker(String str){
int p1;
int s;
s=1;
p1=str.indexOf("<");
x[1]=p1;
while(p1>-1){
p1=str.indexOf("<",p1+1);
if(p1>-1)s=s+1;
if(p1>-1)x[s]=p1;
}
xmlnumber=s;
for(s=1;s<xmlnumber+1;s++){
y[s]=str.indexOf(">",x[s]);
}

}

}
最終更新:2011年05月07日 16:16