|
|
@ -79,9 +79,13 @@
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* 80 */ if (reader != null)
|
|
|
|
/* 80 */ if (reader != null)
|
|
|
|
/* 81 */ reader.close();
|
|
|
|
/* 81 */ {
|
|
|
|
|
|
|
|
reader.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
/* 82 */ if (is != null)
|
|
|
|
/* 82 */ if (is != null)
|
|
|
|
/* 83 */ is.close();
|
|
|
|
/* 83 */ {
|
|
|
|
|
|
|
|
is.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
/* 84 */ } catch (IOException iOException) {} } catch (IOException e) { e.printStackTrace(); } finally { try { if (reader != null) reader.close(); if (is != null) is.close(); } catch (IOException iOException) {} }
|
|
|
|
/* 84 */ } catch (IOException iOException) {} } catch (IOException e) { e.printStackTrace(); } finally { try { if (reader != null) reader.close(); if (is != null) is.close(); } catch (IOException iOException) {} }
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */ }
|
|
|
|
/* */ }
|
|
|
@ -91,30 +95,7 @@
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */ private void initializeHelper() {
|
|
|
|
/* */ private void initializeHelper() {
|
|
|
|
/* 93 */ Map<String, Integer> stringPossibilities = new HashMap<>();
|
|
|
|
/* 93 */
|
|
|
|
/* 94 */ Iterator<String> iter = this.charMap.keySet().iterator();
|
|
|
|
|
|
|
|
/* 95 */ while (iter.hasNext()) {
|
|
|
|
|
|
|
|
/* 96 */ String key = iter.next();
|
|
|
|
|
|
|
|
/* 97 */ if (key.length() >= 1) {
|
|
|
|
|
|
|
|
/* 98 */ for (int i = 0; i < key.length(); i++) {
|
|
|
|
|
|
|
|
/* 99 */ String keySubstring = key.substring(0, i + 1);
|
|
|
|
|
|
|
|
/* 100 */ if (stringPossibilities.containsKey(keySubstring)) {
|
|
|
|
|
|
|
|
/* 101 */ Integer integer = stringPossibilities.get(keySubstring);
|
|
|
|
|
|
|
|
/* 102 */ stringPossibilities.put(keySubstring, new Integer(integer
|
|
|
|
|
|
|
|
/* 103 */ .intValue() + 1));
|
|
|
|
|
|
|
|
/* */ } else {
|
|
|
|
|
|
|
|
/* 105 */ stringPossibilities.put(keySubstring, new Integer(1));
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
/* 110 */ iter = stringPossibilities.keySet().iterator();
|
|
|
|
|
|
|
|
/* 111 */ while (iter.hasNext()) {
|
|
|
|
|
|
|
|
/* 112 */ String key = iter.next();
|
|
|
|
|
|
|
|
/* 113 */ if (((Integer)stringPossibilities.get(key)).intValue() > 1) {
|
|
|
|
|
|
|
|
/* 114 */ this.conflictingSets.add(key);
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
/* */ }
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */ public String convert(String in) {
|
|
|
|
/* */ public String convert(String in) {
|
|
|
@ -125,14 +106,16 @@
|
|
|
|
/* 124 */ String key = "" + c;
|
|
|
|
/* 124 */ String key = "" + c;
|
|
|
|
/* 125 */ stackString.append(key);
|
|
|
|
/* 125 */ stackString.append(key);
|
|
|
|
/* 126 */ if (!this.conflictingSets.contains(stackString.toString()))
|
|
|
|
/* 126 */ if (!this.conflictingSets.contains(stackString.toString()))
|
|
|
|
/* 127 */ if (this.charMap.containsKey(stackString.toString())) {
|
|
|
|
/* 127 */ {
|
|
|
|
/* 128 */ outString.append(this.charMap.get(stackString.toString()));
|
|
|
|
if (this.charMap.containsKey(stackString.toString())) {
|
|
|
|
/* 129 */ stackString.setLength(0);
|
|
|
|
/* 128 */ outString.append(this.charMap.get(stackString.toString()));
|
|
|
|
/* */ } else {
|
|
|
|
/* 129 */ stackString.setLength(0);
|
|
|
|
/* 131 */ CharSequence sequence = stackString.subSequence(0, stackString.length() - 1);
|
|
|
|
/* */ } else {
|
|
|
|
/* 132 */ stackString.delete(0, stackString.length() - 1);
|
|
|
|
/* 131 */ CharSequence sequence = stackString.subSequence(0, stackString.length() - 1);
|
|
|
|
/* 133 */ flushStack(outString, new StringBuilder(sequence));
|
|
|
|
/* 132 */ stackString.delete(0, stackString.length() - 1);
|
|
|
|
/* */ }
|
|
|
|
/* 133 */ flushStack(outString, new StringBuilder(sequence));
|
|
|
|
|
|
|
|
/* */ }
|
|
|
|
|
|
|
|
}
|
|
|
|
/* */ }
|
|
|
|
/* */ }
|
|
|
|
/* 136 */ flushStack(outString, stackString);
|
|
|
|
/* 136 */ flushStack(outString, stackString);
|
|
|
|
/* 137 */ return outString.toString();
|
|
|
|
/* 137 */ return outString.toString();
|
|
|
|