com.ontotext.kim.gate.SettingsHashBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gazetteer-lkb Show documentation
Show all versions of gazetteer-lkb Show documentation
A Large Knowledge Based (LKB) Gazetteer
The newest version!
package com.ontotext.kim.gate;
import gate.util.Files;
import java.io.IOException;
import java.net.URL;
import org.apache.commons.io.FileUtils;
import com.ontotext.kim.util.StringTransformations;
public class SettingsHashBuilder {
public int getHash(URL configFile, String query) {
query = StringTransformations.stripMultiWS(query);
try {
String configString =
FileUtils.readFileToString(Files.fileFromURL(configFile));
configString = StringTransformations.stripMultiWS(configString);
return (query + ";" + configString).hashCode();
}
catch (IOException e) {
return query.hashCode();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy