本文整理汇总了Java中no.priv.garshol.duke.Cleaner.clean方法的典型用法代码示例。如果您正苦于以下问题:Java Cleaner.clean方法的具体用法?Java Cleaner.clean怎么用?Java Cleaner.clean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类no.priv.garshol.duke.Cleaner
的用法示例。
在下文中一共展示了Cleaner.clean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addValue
import no.priv.garshol.duke.Cleaner; //导入方法依赖的package包/类
public void addValue(Column col, String value) {
if (value == null || value.equals(""))
return;
String prop = col.getProperty();
Cleaner cleaner = col.getCleaner();
if (col.isSplit()) {
for (String v : col.split(value)) {
if (cleaner != null)
v = cleaner.clean(v);
if (v != null && !v.equals(""))
record.addValue(prop, v);
}
} else {
if (cleaner != null)
value = cleaner.clean(value);
if (value != null && !value.equals(""))
record.addValue(prop, value);
}
}
示例2: computeProb
import no.priv.garshol.duke.Cleaner; //导入方法依赖的package包/类
private static double computeProb(Collection<String> vs1, Collection<String> vs2, Comparator comp, List<Cleaner> cleanersList, Double max, Double min) {
double high = 0.0;
for (String v1 : vs1) {
if (v1.equals("")) {
continue;
}
v2fieldloop:
for (String v2 : vs2) {
if (v2.equals("")) {
continue;
}
for (Cleaner cl : cleanersList) {
v2 = cl.clean(v2);
if ((v2 == null) || v2.equals("")) {
continue v2fieldloop;
}
}
double p = compare(v1, v2, max, min, comp);
high = Math.max(high, p);
}
}
return high;
}
示例3: readFields
import no.priv.garshol.duke.Cleaner; //导入方法依赖的package包/类
private void readFields(List<Map<String, Object>> fields, Map<String, Collection<String>> props) {
for (Map<String, Object> value : fields) {
String field = (String) value.get("field");
String fieldValue = (String) value.get("value");
for (Cleaner cl : (ArrayList<Cleaner>) entityParams.get(field).get(CLEANERS)) {
fieldValue = cl.clean(fieldValue);
}
props.put(field, Collections.singleton(fieldValue));
}
}