added English synonyms

pull/2/head
Ryszard Goń 10 years ago
parent 5408448a56
commit f3f1b2e899

File diff suppressed because one or more lines are too long

@ -221,6 +221,16 @@
<dt>Action</dt> <dt>Action</dt>
<dd>#(syn0Status)#<input type="submit" name="syn0Activate" value="Activate" />::<input type="submit" name="syn0Deactivate" value="Deactivate" />#(/syn0Status)#</dd> <dd>#(syn0Status)#<input type="submit" name="syn0Activate" value="Activate" />::<input type="submit" name="syn0Deactivate" value="Deactivate" />#(/syn0Status)#</dd>
</dl> </dl>
<h4><a href="http://icon.shef.ac.uk/Moby/" target="_blank">Moby Lexicon - English Thesaurus from http://icon.shef.ac.uk/Moby/</a></h4>
<p>The data from this source was converted to the YaCy synonym file format and part of the YaCy distribution.</p>
<dl>
<dt><label>Status</label></dt>
<dd>#(syn1Status)#<div class="info">Deactivated</div>::<div class="commit">Activated</div>#(/syn1Status)#</dd>
<dt>Action</dt>
<dd>#(syn1Status)#<input type="submit" name="syn1Activate" value="Activate" />::<input type="submit" name="syn1Deactivate" value="Deactivate" />#(/syn1Status)#</dd>
</dl>
</fieldset> </fieldset>
</form> </form>
#%env/templates/footer.template%# #%env/templates/footer.template%#

@ -305,8 +305,27 @@ public class DictionaryLoader_p {
} }
SynonymLibrary.init(synonyms_path); SynonymLibrary.init(synonyms_path);
} }
prop.put("syn0Status", synonym_de_production.exists() ? 1 : 0); prop.put("syn0Status", synonym_de_production.exists() ? 1 : 0);
final File synonym_en_default = new File(new File(new File(sb.appPath, "addon"), "synonyms"), "mobythesaurus_en_yacy");
final File synonym_en_production = new File(synonyms_path, synonym_en_default.getName());
if (post.containsKey("syn1Deactivate")) {
synonym_en_production.delete();
SynonymLibrary.init(synonyms_path);
}
if (post.containsKey("syn1Activate")) {
try {
FileUtils.copy(new FileInputStream(synonym_en_default), synonym_en_production);
} catch (IOException e) {
ConcurrentLog.logException(e);
}
SynonymLibrary.init(synonyms_path);
}
prop.put("syn1Status", synonym_en_production.exists() ? 1 : 0);
// check status again // check status again
boolean keepPlacesTagging = false; boolean keepPlacesTagging = false;
for (final LibraryProvider.Dictionary dictionary: LibraryProvider.Dictionary.values()) { for (final LibraryProvider.Dictionary dictionary: LibraryProvider.Dictionary.values()) {

Loading…
Cancel
Save