added English synonyms

This commit is contained in:
Ryszard Goń 2015-04-17 16:15:35 +02:00
parent 5408448a56
commit f3f1b2e899
3 changed files with 30304 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -221,6 +221,16 @@
<dt>Action</dt>
<dd>#(syn0Status)#<input type="submit" name="syn0Activate" value="Activate" />::<input type="submit" name="syn0Deactivate" value="Deactivate" />#(/syn0Status)#</dd>
</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>
</form>
#%env/templates/footer.template%#

View File

@ -305,8 +305,27 @@ public class DictionaryLoader_p {
}
SynonymLibrary.init(synonyms_path);
}
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
boolean keepPlacesTagging = false;
for (final LibraryProvider.Dictionary dictionary: LibraryProvider.Dictionary.values()) {