|
|
|
@ -254,7 +254,11 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
String interpretOutput(String[] jp_data,String[] en_data) { |
|
|
|
|
//[6, 0, 218, 0, 218, 48, 6, 48, 32 5 4 1 5, 0.9670235803680689]
|
|
|
|
|
//For each data point we want to first see if it's within the correct rectangular bounds and from there parse it as such.
|
|
|
|
|
double accuracy[] = new double[readRegions.size()]; |
|
|
|
|
double[] accuracy = new double[readRegions.size()]; |
|
|
|
|
String[] finalData = new String[readRegions.size()]; |
|
|
|
|
for (int i=0;i<finalData.length;i++) { |
|
|
|
|
finalData[i]=""; |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<en_data.length;i+=10) { |
|
|
|
|
int spacing=0; |
|
|
|
|
for (int j=0;j<readRegions.size();j++) { |
|
|
|
@ -270,6 +274,7 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
} |
|
|
|
|
System.out.print("]"); |
|
|
|
|
System.out.println(" belongs to region "+j+"."); |
|
|
|
|
finalData[j]=finalData[j]+"\n"+en_data[i+8]; |
|
|
|
|
accuracy[j]=Double.parseDouble(en_data[i+9]); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -277,8 +282,48 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<jp_data.length;i+=10) { |
|
|
|
|
|
|
|
|
|
int spacing=0; |
|
|
|
|
for (int j=0;j<readRegions.size();j++) { |
|
|
|
|
int midpoint=(Integer.parseInt(jp_data[i+1])+Integer.parseInt(jp_data[i+5]))/2; |
|
|
|
|
if (midpoint>=spacing&&midpoint<=spacing+readRegions.get(j).h+REGION_PADDING |
|
|
|
|
&&accuracy[j]<Double.parseDouble(jp_data[i+9])) { |
|
|
|
|
System.out.print("JP["); |
|
|
|
|
for (int k=0;k<10;k++) { |
|
|
|
|
if (k!=0) { |
|
|
|
|
System.out.print(","); |
|
|
|
|
} |
|
|
|
|
System.out.print(jp_data[i+k]); |
|
|
|
|
} |
|
|
|
|
System.out.print("]"); |
|
|
|
|
System.out.println(" belongs to region "+j+"."); |
|
|
|
|
if (accuracy[j]!=0) { |
|
|
|
|
finalData[j]=""; |
|
|
|
|
} |
|
|
|
|
finalData[j]=finalData[j]+"\n"+jp_data[i+8]; |
|
|
|
|
accuracy[j]=0; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
spacing+=readRegions.get(j).h+REGION_PADDING; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
System.out.println(Arrays.toString(finalData)); |
|
|
|
|
interpretResults(finalData); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void interpretResults(String[] finalData) { |
|
|
|
|
for (int i=0;i<finalData.length;i++) { |
|
|
|
|
String[] splitter = finalData[i].split(Pattern.quote("\n")); |
|
|
|
|
switch (i) { |
|
|
|
|
case 0:{ |
|
|
|
|
score=convertToInt(splitter); |
|
|
|
|
}break; |
|
|
|
|
case 1:{}break; //We will handle the grade with another system.
|
|
|
|
|
case 2:{ |
|
|
|
|
notes[0]=convertToInt("PERFECT",splitter); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
System.out.println(this); |
|
|
|
|
} |
|
|
|
|
} |