/** * Loads the (serialized) PriorityTree. * * @author DirkK */ private void loadTree() { tree = new PriorityTree(); boolean successfullyCharsLoaded = tree.loadChars(properties.getProperty("chars")); if (!successfullyCharsLoaded) { properties.setProperty("chars", Config.getConf().getProperty("defaultAllowedChars")); tree.loadChars(Config.getConf().getProperty("defaultAllowedChars")); } new Thread() { public void run() { try { tree.importFromHashMap( ImportExportManager.importFromFile(properties.getProperty("tree"), true)); } catch (IOException err) { logger.warn( "Could not fetch the dictionary for the proifle " + properties.getProperty("name") + ", File: " + properties.getProperty("tree")); } logger.debug("Tree successfully loaded"); dictionaryLoaded = true; Controller.getInstance().showStatusMessage("Dictionary loaded"); } }.start(); }
public void setAllowedChars(String allowedChars) { tree.loadChars(allowedChars); properties.setProperty("chars", allowedChars); }