Changeset 6069 for trunk/gli/src/org/greenstone/gatherer/util/Codec.java
- Timestamp:
- 2003-12-01T19:52:02+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/Codec.java
r6051 r6069 37 37 */ 38 38 public class Codec { 39 39 40 40 static final public String DECODE_PATH = "DECODE_PATH"; 41 static final public String DOM_TO_GREENSTONE = "DOM_TO_GREENSTONE"; 42 static final public String DOM_TO_TEXT = "DOM_TO_TEXT"; 41 static final public String DECODE_SQUARE_BRACKETS = "DECODE_SQUARE_BRACKETS"; 42 static final public String DOM_TO_GREENSTONE = "DOM_TO_GREENSTONE"; 43 static final public String DOM_TO_TEXT = "DOM_TO_TEXT"; 43 44 static final public String ENCODE_PATH = "ENCODE_PATH"; 44 static final public String GREENSTONE_TO_DOM = "GREENSTONE_TO_DOM";45 static final public String GREENSTONE_TO_TEXT = "GREENSTONE_TO_TEXT";46 static final public String REMOVE_SQUARE_BRACKET = "REMOVE_SQUARE_BRACKET";47 static final public String TEXT_TO_DOM = "TEXT_TO_DOM";48 static final public String TEXT_TO_GREENSTONE = "TEXT_TO_GREENSTONE";49 static final public String TEXT_TO_SHELL_UNIX = "TEXT_TO_SHELL_UNIX";50 static final public String TEXT_TO_SHELL_WINDOWS = "TEXT_TO_SHELL_WINDOWS";51 45 static final public String ENCODE_SQUARE_BRACKETS = "ENCODE_SQUARE_BRACKETS"; 46 static final public String GREENSTONE_TO_DOM = "GREENSTONE_TO_DOM"; 47 static final public String GREENSTONE_TO_TEXT = "GREENSTONE_TO_TEXT"; 48 static final public String TEXT_TO_DOM = "TEXT_TO_DOM"; 49 static final public String TEXT_TO_GREENSTONE = "TEXT_TO_GREENSTONE"; 50 static final public String TEXT_TO_SHELL_UNIX = "TEXT_TO_SHELL_UNIX"; 51 static final public String TEXT_TO_SHELL_WINDOWS = "TEXT_TO_SHELL_WINDOWS"; 52 52 53 static final private int MAX_CACHE_SIZE = 100; 53 54 54 55 static private HashMap TRANSFORMS; 55 56 static private HashMap3D CACHE; 56 57 57 58 58 /** Static function called to construct TRANSFORMS mappings */ 59 59 static { … … 61 61 62 62 String[] decode_path = { 63 "\\|", "\\\\" 63 "\\|", "\\\\", 64 "|", "\\|" 64 65 }; 65 66 TRANSFORMS.put(DECODE_PATH, decode_path); 66 67 decode_path = null; 68 69 // Transform text into text, but without [ and ] 70 String[] decode_square_brackets = { 71 "[", "\\[", 72 "]", "\\]" 73 }; 74 TRANSFORMS.put(DECODE_SQUARE_BRACKETS, decode_square_brackets); 75 decode_square_brackets = null; 67 76 68 77 // Translate DOM encoded text into Greenstone encoding … … 94 103 95 104 String[] encode_path = { 105 "\\|", "|", 96 106 "\\\\", "\\|" 97 107 }; 98 108 TRANSFORMS.put(ENCODE_PATH, encode_path); 99 109 encode_path = null; 110 111 // Transform text into text, but without [ and ] 112 String[] encode_square_brackets = { 113 "\\[", "[", 114 "\\]", "]" 115 }; 116 TRANSFORMS.put(ENCODE_SQUARE_BRACKETS, encode_square_brackets); 117 encode_square_brackets = null; 100 118 101 119 // Transform Greenstone encoded text to DOM encoding … … 125 143 TRANSFORMS.put(GREENSTONE_TO_TEXT, greenstone_to_text); 126 144 greenstone_to_text = null; 127 128 // Transform text into text, but without [ and ]129 String[] remove_square_bracket = {130 "\\[", "[",131 "\\]", "]"132 };133 TRANSFORMS.put(REMOVE_SQUARE_BRACKET, remove_square_bracket);134 remove_square_bracket = null;135 145 136 146 // Transform plain html text into something that can be placed in a DOM
Note:
See TracChangeset
for help on using the changeset viewer.