Skip to content

Commit

Permalink
Проверка порядка теперь включается флагом. #24
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakov Sirotkin committed Aug 20, 2014
1 parent 7f1e1d5 commit 5ddd003
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions support/src/org/spbelect/OfficialCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import java.util.regex.Pattern;

public class OfficialCheck {
static boolean checkOrder = true;

public static void main(String[] args) throws Exception {

Map<Integer, Set<String>> uiksMap = new HashMap<>();
File[] tiks = new File("spbuik").listFiles(new FilenameFilter() {
@Override
Expand Down Expand Up @@ -43,7 +46,9 @@ public boolean accept(File dir, String name) {
int pointIndex = s2.indexOf(".");
if (pointIndex > 0 && pointIndex < 4) {
//System.out.println(s2);
//s2 = s2.substring(pointIndex + 1).trim();
if (!checkOrder) {
s2 = s2.substring(pointIndex + 1).trim();
}
if (s2.contains("19")) {
//System.out.println(s2);
s2 = s2.substring(0, s2.lastIndexOf(" ")).trim();
Expand Down Expand Up @@ -92,7 +97,8 @@ public boolean accept(File dir, String name) {
int prevOpen = page.lastIndexOf("<td>", prevClose);
String id = page.substring(prevOpen + 4, prevClose).trim();

String name = id + ". " + page.substring(pos, end).trim();
String name = checkOrder ? id + ". " : "";
name += page.substring(pos, end).trim();
total++;
String td = "<td>";
pos = page.indexOf(td, end) + td.length();
Expand Down

0 comments on commit 5ddd003

Please sign in to comment.