refactoring with CommonPattern.COMMA

pull/1/head
Michael Peter Christen 10 years ago
parent cf9b22ca5c
commit ac19690d30

@ -830,6 +830,7 @@ search.result.show.cache = true
search.result.show.proxy = false
search.result.show.hostbrowser = true
search.result.show.vocabulary = false
search.result.show.vocabulary.omit =
# search navigators: comma-separated list of default values for search navigation.

@ -42,6 +42,7 @@ import net.yacy.cora.geo.Locations;
import net.yacy.cora.storage.Files;
import net.yacy.cora.util.CommonPattern;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.search.Switchboard;
public class Tagging {
@ -212,7 +213,6 @@ public class Tagging {
String[] tags;
int p;
String line;
Pattern kommapattern = Pattern.compile(",");
try {
String[] pl;
vocloop: while ((line = list.take()) != Files.POISON_LINE) {
@ -245,7 +245,7 @@ public class Tagging {
}
term = normalizeKey(pl[0]);
v = pl[1];
tags = kommapattern.split(v);
tags = CommonPattern.COMMA.split(v);
Set<String> synonyms = new HashSet<String>();
synonyms.add(term);
tagloop: for (String synonym: tags) {
@ -278,6 +278,8 @@ public class Tagging {
public void setFacet(boolean isFacet) {
this.isFacet = isFacet;
String omit = Switchboard.getSwitchboard().getConfig("search.result.show.vocabulary.omit", "");
}
public int size() {
@ -551,7 +553,6 @@ public class Tagging {
private final static Pattern PATTERN_OE = Pattern.compile("\u00F6");
private final static Pattern PATTERN_UE = Pattern.compile("\u00FC");
private final static Pattern PATTERN_SZ = Pattern.compile("\u00DF");
private final static Pattern PATTERN_COMMA = Pattern.compile(",");
public static final String normalizeTerm(String term) {
term = term.trim().toLowerCase();
@ -559,7 +560,7 @@ public class Tagging {
term = PATTERN_OE.matcher(term).replaceAll("oe");
term = PATTERN_UE.matcher(term).replaceAll("ue");
term = PATTERN_SZ.matcher(term).replaceAll("ss");
term = PATTERN_COMMA.matcher(term).replaceAll(" ");
term = CommonPattern.COMMA.matcher(term).replaceAll(" ");
return term;
}

@ -35,6 +35,7 @@ import java.util.Set;
import java.util.Vector;
import java.util.regex.Pattern;
import net.yacy.cora.util.CommonPattern;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.repository.BlacklistFile;
@ -45,8 +46,6 @@ import net.yacy.search.query.SearchEventCache;
public class ListManager {
private final static Pattern commaPattern = Pattern.compile(",");
public static Switchboard switchboard = null;
public static File listsPath = null;
@ -147,7 +146,7 @@ public class ListManager {
ArrayList<String> list;
if (string != null && string.length() > 0) {
list = new ArrayList<String>(Arrays.asList(commaPattern.split(string, 0)));
list = new ArrayList<String>(Arrays.asList(CommonPattern.COMMA.split(string, 0)));
} else {
list = new ArrayList<String>();
}
@ -165,7 +164,7 @@ public class ListManager {
HashSet<String> set;
if (string != null) {
set = new HashSet<String>(Arrays.asList(commaPattern.split(string, 0)));
set = new HashSet<String>(Arrays.asList(CommonPattern.COMMA.split(string, 0)));
} else {
set = new HashSet<String>();
}
@ -184,7 +183,7 @@ public class ListManager {
Vector<String> v;
if (string != null) {
v = new Vector<String>(Arrays.asList(commaPattern.split(string, 0)));
v = new Vector<String>(Arrays.asList(CommonPattern.COMMA.split(string, 0)));
} else {
v = new Vector<String>();
}

@ -53,7 +53,6 @@ import net.yacy.kelondro.util.kelondroException;
public final class Row implements Serializable {
//private final static Pattern commaPattern = Pattern.compile(",");
private static final long serialVersionUID=-148412365988669116L;
protected final Column[] row;

Loading…
Cancel
Save