Ignore:
Timestamp:
2019-10-17T21:05:21+13:00 (5 years ago)
Author:
ak19
Message:

Debugging. Solved one problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/maori-lang-detection/src/org/greenstone/atea/TextDumpPage.java

    r33578 r33579  
    2727        // first line always has a "key:" somewhere after the pageURL
    2828        int endIndex = line.indexOf("key:");
    29         String pageURL = line.substring(endIndex);
     29
     30        //String pageURL = line.substring(0, endIndex);
     31        String pageURL = (endIndex == -1) ? line : line.substring(0, endIndex);     
     32       
    3033       
    3134        tuples.put("pageURL", pageURL.trim());
    3235
    33         String key = line.substring(endIndex);
    34         tuples.put("key", key.trim());
     36        if(endIndex != -1) {
     37        String key = line.substring(endIndex);
     38        tuples.put("key", key.trim());
     39        } else {
     40        debug("@@@@ no key for pageURL: " + pageURL);
     41        }
     42
     43        if(pageURL.contains(TEXT_END_MARKER)) {
     44        debug("@@@@ TEXT_END_MARKER assigned to pageURL for page: ");
     45        debug("+++++++++");
     46        debug(unparsedPageDump);
     47        debug("+++++++++");
     48        }
    3549
    3650        boolean readingPageText = false;
     
    7791        tuples.put("pageText", "");
    7892        }
     93
    7994       
    8095    } catch (IOException ioe) {
    8196        error("@@@@@@@@@ Error reading in txtdump of a page.", ioe);
    8297    }
     98
     99    /*
     100    // START DEBUG
     101    debug("__________________________________________");
     102    for(Map.Entry<String, String> entry : tuples.entrySet()) {
     103        String key = entry.getKey();
     104        String value = entry.getValue();       
     105        debug(key + " - " + value);
     106    }
     107    debug("__________________________________________");
     108    // END DEBUG
     109    */
    83110    }
    84111
Note: See TracChangeset for help on using the changeset viewer.