From 743b0ec89fa5939adec51e74b9694b3af6400e95 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 17 Jun 2012 17:32:52 +0200 Subject: [PATCH] - added size of vocabulary to vocabulary view - fixed bad terms in vocabulary-from-titles autogeneration --- htroot/Vocabulary_p.html | 1 + htroot/Vocabulary_p.java | 3 +++ source/net/yacy/cora/lod/vocabulary/Tagging.java | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htroot/Vocabulary_p.html b/htroot/Vocabulary_p.html index c073b9abf..0e980fd7f 100644 --- a/htroot/Vocabulary_p.html +++ b/htroot/Vocabulary_p.html @@ -107,6 +107,7 @@ function updatepage(str) {
Vocabulary Name
#[name]#
File
#(editable)#[automatically generated, not stored, cannot be edited]::#[file]##(/editable)#
+
Size
#[size]#
Namespace
#[namespace]#
Predicate
#[predicate]#
Prefix
#[prefix]#
diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.java index b1899c254..87080a1a4 100644 --- a/htroot/Vocabulary_p.java +++ b/htroot/Vocabulary_p.java @@ -90,6 +90,7 @@ public class Vocabulary_p { if (discoverFromTitle || discoverFromTitleSplitted) { URIMetadataRow m = segment.urlMetadata().load(u.hash()); if (m != null) t = m.dc_title(); + if (t.endsWith(".jpg") || t.endsWith(".gif")) continue; } if (discoverFromAuthor) { URIMetadataRow m = segment.urlMetadata().load(u.hash()); @@ -101,6 +102,7 @@ public class Vocabulary_p { String[] ts = t.split(" "); for (String s: ts) { if (s.length() == 0) continue; + if (s.endsWith(".jpg") || s.endsWith(".gif")) continue; table.put(s, new Tagging.SOTuple("", u0)); } } else if (discoverFromAuthor) { @@ -189,6 +191,7 @@ public class Vocabulary_p { prop.putHTML("edit_editable_file", editable ? vocabulary.getFile().getAbsolutePath() : ""); prop.putHTML("edit_name", vocabulary.getName()); prop.putHTML("edit_namespace", vocabulary.getNamespace()); + prop.put("edit_size", vocabulary.size()); prop.putHTML("edit_predicate", vocabulary.getPredicate()); prop.putHTML("edit_prefix", Tagging.DEFAULT_PREFIX); prop.putHTML("edit_editable_objectspace", vocabulary.getObjectspace() == null ? "" : vocabulary.getObjectspace()); diff --git a/source/net/yacy/cora/lod/vocabulary/Tagging.java b/source/net/yacy/cora/lod/vocabulary/Tagging.java index 1e0331d74..57604d0aa 100644 --- a/source/net/yacy/cora/lod/vocabulary/Tagging.java +++ b/source/net/yacy/cora/lod/vocabulary/Tagging.java @@ -169,9 +169,8 @@ public class Tagging { } - - public void updateTerm(String term, String[] synonyms) { - + public int size() { + return this.term2objectlink.size(); } private File tmpFile() {