From cc090bcb01bd240be911426f85e811f4e323c348 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 23 Dec 2014 00:37:51 +0100 Subject: [PATCH] enhanced initialization of autotagging --- source/net/yacy/cora/lod/vocabulary/Tagging.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/net/yacy/cora/lod/vocabulary/Tagging.java b/source/net/yacy/cora/lod/vocabulary/Tagging.java index 159aa9f22..1426495d9 100644 --- a/source/net/yacy/cora/lod/vocabulary/Tagging.java +++ b/source/net/yacy/cora/lod/vocabulary/Tagging.java @@ -208,7 +208,9 @@ public class Tagging { String[] tags; int p; String line; + Pattern kommapattern = Pattern.compile(","); try { + String[] pl; vocloop: while ((line = list.take()) != Files.POISON_LINE) { line = line.trim(); p = line.indexOf('#'); @@ -226,10 +228,8 @@ public class Tagging { continue vocloop; } } - String[] pl = parseLine(line); - if (pl == null) { - continue vocloop; - } + pl = parseLine(line); + if (pl == null) continue vocloop; if (pl[1] == null) { term = normalizeKey(pl[0]); v = normalizeTerm(pl[0]); @@ -240,7 +240,7 @@ public class Tagging { } term = normalizeKey(pl[0]); v = pl[1]; - tags = v.split(","); + tags = kommapattern.split(v); Set synonyms = new HashSet(); synonyms.add(term); tagloop: for (String synonym: tags) {