Changeset 10668


Ignore:
Timestamp:
2005-09-30T10:52:55+12:00 (19 years ago)
Author:
mdewsnip
Message:

Added code to remove comments from the text strings -- this is needed when the GTI is used, as it adds "# Updated XX-XX-XXXX" to the end of strings to keep track of when they were last updated.

File:
1 edited

Legend:

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

    r10345 r10668  
    132132        initial = new String(initial_raw.getBytes("ISO-8859-1"), "UTF-8");
    133133        }
    134         catch (Exception ex) {
    135         System.err.println("Exception: " + ex);
    136         ex.printStackTrace();
     134        catch (Exception exception) {
     135        DebugStream.printStackTrace(exception);
    137136        return initial_raw;
     137        }
     138
     139        // Remove any comments from the string
     140        if (initial.indexOf("#") != -1) {
     141        initial = initial.substring(0, initial.indexOf("#"));
    138142        }
    139143
     
    142146
    143147        // While we still have initial string left.
    144         while(initial.length() > 0 && initial.indexOf('{') != -1 && initial.indexOf('}') != -1) {
     148        while (initial.length() > 0 && initial.indexOf('{') != -1 && initial.indexOf('}') != -1) {
    145149        // Remove preamble
    146150        int opening = initial.indexOf('{');
     
    183187        return complete;
    184188    }
    185     catch (Exception e) {
     189    catch (Exception exception) {
    186190        System.err.println("Missing value for key: " + key);
    187191        // DebugStream.printStackTrace(e);
Note: See TracChangeset for help on using the changeset viewer.