diff --git a/.gitignore b/.gitignore index b72f34f47..504fad6c9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dkm-commandlist.txt */.project */.settings *.versionsBackup +*# \ No newline at end of file diff --git a/docs/download.html b/docs/download.html index d5c2d733c..7d6ff92c7 100644 --- a/docs/download.html +++ b/docs/download.html @@ -351,7 +351,28 @@

buffers = new HashMap<>(); - ArrayList additionalBuffers = new ArrayList<>(); - - buffers.put("id", new StringBuffer()); - buffers.put("form", new StringBuffer()); - buffers.put("lemma", new StringBuffer()); - buffers.put("pos", new StringBuffer()); - buffers.put("deplabel", new StringBuffer()); - buffers.put("depparent", new StringBuffer()); - - for (Word word : sentence) { - buffers.get("id").append(word.getId()).append('\t'); - buffers.get("form").append(word.getForm()).append('\t'); - buffers.get("lemma").append(word.getLemma()).append('\t'); - buffers.get("pos").append(word.getPos()).append('\t'); - buffers.get("deplabel").append(word.getDepLabel()).append('\t'); - buffers.get("depparent").append(word.getDepParent()).append('\t'); - } - - for (Srl srl : sentence.getSrls()) { - StringBuffer stringBuffer = new StringBuffer(); - HashMap tokens = new HashMap<>(); - - for (Word word : srl.getTarget()) { - tokens.put(word.getId(), srl.getLabel()); - } - for (Role role : srl.getRoles()) { - for (Word word : role.getSpan()) { - Set descendants = sentence.getDescendants(word.getId()); - for (Integer descendant : descendants) { - tokens.put(descendant, role.getLabel()); - } - } - } - - for (int i = 0; i < sentence.getWords().size(); i++) { - String s = tokens.get(i + 1); - if (s != null) { - stringBuffer.append(s); - } - else { - stringBuffer.append("-"); - } - stringBuffer.append('\t'); - } - - additionalBuffers.add(stringBuffer); - } - - writer.append(buffers.get("id").toString().trim()).append('\n'); - writer.append(buffers.get("form").toString().trim()).append('\n'); - writer.append(buffers.get("lemma").toString().trim()).append('\n'); - writer.append(buffers.get("pos").toString().trim()).append('\n'); - writer.append(buffers.get("deplabel").toString().trim()).append('\n'); - writer.append(buffers.get("depparent").toString().trim()).append('\n'); - - for (StringBuffer buffer : additionalBuffers) { - String s = buffer.toString(); - s = s.substring(0, s.length() - 1); - writer.append(s).append('\n'); - } - - writer.append('\n'); - } - - writer.close(); - - } -} diff --git a/pikes-twm/src/main/java/eu/fbk/dkm/pikes/twm/DBpediaSpotlightAnnotate.java b/pikes-twm/src/main/java/eu/fbk/dkm/pikes/twm/DBpediaSpotlightAnnotate.java index b175aa36b..87c9be447 100644 --- a/pikes-twm/src/main/java/eu/fbk/dkm/pikes/twm/DBpediaSpotlightAnnotate.java +++ b/pikes-twm/src/main/java/eu/fbk/dkm/pikes/twm/DBpediaSpotlightAnnotate.java @@ -19,7 +19,7 @@ public class DBpediaSpotlightAnnotate extends Linking { private static String LABEL = "dbpedia-annotate"; private String confidence; - public static final String DBPS_ADDRESS = "http://spotlight.sztaki.hu:2222/rest"; + public static final String DBPS_ADDRESS = "https://api.dbpedia-spotlight.org/en"; public static final double DBPS_MIN_CONFIDENCE = 0.33; public DBpediaSpotlightAnnotate(Properties properties) { diff --git a/pom.xml b/pom.xml index d0eba245b..51e09c04e 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,11 @@ fbk-repo https://raw.githubusercontent.com/fbk/mvn-repo/master/releases + + KnowItAll + http://knowitall.cs.washington.edu/maven2/ + +