refactoring

pull/1/head
Michael Peter Christen 12 years ago
parent 406e1f3e7e
commit 31485a963d

@ -18,7 +18,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy.document;
package net.yacy.cora.language.synonyms;
import java.io.File;
import java.io.IOException;
@ -27,17 +27,19 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Logger;
import net.yacy.cora.geo.Locations;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.kelondro.logging.Log;
/**
* Autotagging provides a set of tag/print-name properties which can be used to
* - create tags from texts automatically
* - create navigation entries for given tags
*/
public class Autotagging {
public class AutotaggingLibrary {
private final static Logger log = Logger.getLogger(AutotaggingLibrary.class);
private final static Object PRESENT = new Object();
private final File autotaggingPath;
@ -53,7 +55,7 @@ public class Autotagging {
* properties without values are allowed (the value is then set to the key)
* also the value can be used as a tag
*/
public Autotagging(final File autotaggingPath) {
public AutotaggingLibrary(final File autotaggingPath) {
this.vocabularies = new ConcurrentHashMap<String, Tagging>();
this.autotaggingPath = autotaggingPath;
this.allTags = new ConcurrentHashMap<String, Object>();
@ -73,7 +75,7 @@ public class Autotagging {
this.allTags.put(t, PRESENT);
}
} catch (final IOException e) {
Log.logException(e);
log.warn(e.getMessage(), e);
}
}
}

@ -47,6 +47,7 @@ import net.yacy.cora.document.WordCache;
import net.yacy.cora.geo.GeonamesLocation;
import net.yacy.cora.geo.OpenGeoDBLocation;
import net.yacy.cora.geo.OverarchingLocation;
import net.yacy.cora.language.synonyms.AutotaggingLibrary;
import net.yacy.cora.language.synonyms.SynonymLibrary;
import net.yacy.cora.lod.JenaTripleStore;
import net.yacy.cora.lod.vocabulary.Tagging;
@ -67,7 +68,7 @@ public class LibraryProvider {
public static final String disabledExtension = ".disabled";
public static WordCache dymLib = new WordCache(null);
public static Autotagging autotagging = null;
public static AutotaggingLibrary autotagging = null;
public static SynonymLibrary synonyms = null;
public static OverarchingLocation geoLoc = new OverarchingLocation();
private static File dictSource = null;
@ -185,7 +186,7 @@ public class LibraryProvider {
if ( !autotaggingPath.exists() ) {
autotaggingPath.mkdirs();
}
autotagging = new Autotagging(autotaggingPath);
autotagging = new AutotaggingLibrary(autotaggingPath);
}
public static void initSynonyms() {
final File synonymPath = new File(dictRoot, path_to_synonym_dictionaries);

Loading…
Cancel
Save