Changeset 7481 for trunk/indexers/mg


Ignore:
Timestamp:
2004-05-27T16:52:59+12:00 (20 years ago)
Author:
kjdon
Message:

need -1 in the split function to keep empty strings at the end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/indexers/mg/java/org/greenstone/mg/MGPassesWrapper.java

    r7460 r7481  
    122122    /** process a Greenstone document, which may consist of many MG documents (seeparated by ^B */
    123123    public boolean processDocument(String docs_text) {
    124     String [] docs = docs_text.split(String.valueOf(END_OF_DOCUMENT));
    125     System.err.println("num docs split into "+docs.length);
     124    // need -1 in the following to keep empty strings at the end
     125    String [] docs = docs_text.split(String.valueOf(END_OF_DOCUMENT), -1);
     126    System.err.println("GS document split into "+docs.length+" mg documents");
    126127    for (int i=0; i<docs.length; i++) {
    127128        try {
Note: See TracChangeset for help on using the changeset viewer.