Changeset 5986


Ignore:
Timestamp:
2003-11-25T16:15:26+13:00 (20 years ago)
Author:
jmt12
Message:

Arguments in the dictionary can now be annotated with more meaningful names by adding '-name' such as in {0-Collection name}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r5862 r5986  
    289289        int opening = initial.indexOf('{');
    290290        int closing = initial.indexOf('}');
     291        int comment_mark = initial.indexOf('-', opening); // May not exist
     292        if(comment_mark > closing) { // May also be detecting a later comment
     293            comment_mark = -1;
     294        }
    291295        complete = complete + initial.substring(0, opening);
    292296        // Parse arg_num
    293         String arg_str = initial.substring(opening + 1, closing);
     297        String arg_str = null;
     298        if(comment_mark != -1) {
     299            arg_str = initial.substring(opening + 1, comment_mark);
     300        }
     301        else {
     302            arg_str = initial.substring(opening + 1, closing);
     303        }
    294304        int arg_num = Integer.parseInt(arg_str);
    295305        if(closing + 1 < initial.length()) {
     
    318328    catch (Exception e) {
    319329        System.err.println("Missing value for key: " + key);
     330        Gatherer.printStackTrace(e);
    320331        return key;
    321332    }
Note: See TracChangeset for help on using the changeset viewer.