enhanced initialization of autotagging

pull/1/head
Michael Peter Christen 10 years ago
parent 003ec43bee
commit cc090bcb01

@ -208,7 +208,9 @@ public class Tagging {
String[] tags; String[] tags;
int p; int p;
String line; String line;
Pattern kommapattern = Pattern.compile(",");
try { try {
String[] pl;
vocloop: while ((line = list.take()) != Files.POISON_LINE) { vocloop: while ((line = list.take()) != Files.POISON_LINE) {
line = line.trim(); line = line.trim();
p = line.indexOf('#'); p = line.indexOf('#');
@ -226,10 +228,8 @@ public class Tagging {
continue vocloop; continue vocloop;
} }
} }
String[] pl = parseLine(line); pl = parseLine(line);
if (pl == null) { if (pl == null) continue vocloop;
continue vocloop;
}
if (pl[1] == null) { if (pl[1] == null) {
term = normalizeKey(pl[0]); term = normalizeKey(pl[0]);
v = normalizeTerm(pl[0]); v = normalizeTerm(pl[0]);
@ -240,7 +240,7 @@ public class Tagging {
} }
term = normalizeKey(pl[0]); term = normalizeKey(pl[0]);
v = pl[1]; v = pl[1];
tags = v.split(","); tags = kommapattern.split(v);
Set<String> synonyms = new HashSet<String>(); Set<String> synonyms = new HashSet<String>();
synonyms.add(term); synonyms.add(term);
tagloop: for (String synonym: tags) { tagloop: for (String synonym: tags) {

Loading…
Cancel
Save