Révision 1682
| tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/preferences/TreeTaggerPreferences.java (revision 1682) | ||
|---|---|---|
| 82 | 82 |
public void initializeDefaultPreferences() {
|
| 83 | 83 |
super.initializeDefaultPreferences(); |
| 84 | 84 |
|
| 85 |
// FIXME: SJ: some code in this method should only be done at first run or update (eg. modifying chmod, etc.) |
|
| 86 |
|
|
| 87 |
|
|
| 85 | 88 |
// Default preferences if no org.txm.treetagger.core fragment is found |
| 86 | 89 |
Preferences preferences = this.getDefaultPreferencesNode(); |
| 87 | 90 |
|
| ... | ... | |
| 161 | 164 |
if (binariesFragmentVersion != null && binariesFragmentVersion.compareTo(currentBVersion) >= 0) { // udpate binaries path !
|
| 162 | 165 |
Log.fine("Updating TreeTagger binaries path...");
|
| 163 | 166 |
File path = BundleUtils.getBundleFile(bfragmentid); |
| 164 |
File binariesDir = new File(path, "res/"+osname); |
|
| 165 |
new File(binariesDir, "bin/separate-punctuation").setExecutable(true); // linux&mac |
|
| 166 |
new File(binariesDir, "bin/tree-tagger").setExecutable(true); // linux&mac |
|
| 167 |
new File(binariesDir, "bin/train-tree-tagger").setExecutable(true); // linux&mac |
|
| 167 |
File binariesDir = new File(path, "res/"+osname); //$NON-NLS-1$
|
|
| 168 |
new File(binariesDir, "bin/separate-punctuation").setExecutable(true); // linux&mac //$NON-NLS-1$
|
|
| 169 |
new File(binariesDir, "bin/tree-tagger").setExecutable(true); // linux&mac //$NON-NLS-1$
|
|
| 170 |
new File(binariesDir, "bin/train-tree-tagger").setExecutable(true); // linux&mac //$NON-NLS-1$
|
|
| 168 | 171 |
preferences.put(INSTALL_PATH, binariesDir.getAbsolutePath()); |
| 169 | 172 |
TreeTaggerPreferences.getInstance().put(INSTALLED_BINARIES_VERSION, binariesFragmentVersion.toString()); |
| 170 |
Log.fine("Done.");
|
|
| 173 |
Log.fine("Done."); //$NON-NLS-1$
|
|
| 171 | 174 |
} |
| 172 | 175 |
|
| 173 | 176 |
Version modelsFragmentVersion = BundleUtils.getBundleVersion(mfragmentid); |
| 174 | 177 |
if (modelsFragmentVersion != null && modelsFragmentVersion.compareTo(currentMVersion) >= 0) { // udpate models path!
|
| 175 |
Log.fine("Updating TreeTagger models path...");
|
|
| 178 |
Log.fine("Updating TreeTagger models path..."); //$NON-NLS-1$
|
|
| 176 | 179 |
File path = BundleUtils.getBundleFile(mfragmentid); |
| 177 | 180 |
|
| 178 |
File installModelsDir = new File(path, "res/models"); |
|
| 179 |
File modelsDir = new File(Toolbox.getTxmHomePath(), "treetagger-models"); |
|
| 181 |
File installModelsDir = new File(path, "res/models"); //$NON-NLS-1$
|
|
| 182 |
File modelsDir = new File(Toolbox.getTxmHomePath(), "treetagger-models"); //$NON-NLS-1$
|
|
| 180 | 183 |
modelsDir.mkdirs(); |
| 181 | 184 |
try {
|
| 182 | 185 |
FileCopy.copyFiles(installModelsDir, modelsDir); |
| 183 | 186 |
preferences.put(MODELS_PATH, modelsDir.getAbsolutePath()); //$NON-NLS-1$ |
| 184 | 187 |
TreeTaggerPreferences.getInstance().put(INSTALLED_MODELS_VERSION, modelsFragmentVersion.toString()); |
| 185 |
Log.fine("Done.");
|
|
| 188 |
Log.fine("Done."); //$NON-NLS-1$
|
|
| 186 | 189 |
} catch (IOException e) {
|
| 187 | 190 |
// TODO Auto-generated catch block |
| 188 | 191 |
e.printStackTrace(); |
Formats disponibles : Unified diff