Revision 49440
Added by Claudio Atzori over 6 years ago
LowercaseClustering.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.pace.clustering; |
2 | 2 |
|
3 | 3 |
import java.util.Collection; |
4 |
import java.util.List; |
|
4 | 5 |
import java.util.Map; |
5 | 6 |
|
6 | 7 |
import com.google.common.collect.Lists; |
8 |
import com.google.common.collect.Sets; |
|
9 |
import eu.dnetlib.pace.model.Field; |
|
7 | 10 |
import org.apache.commons.lang.StringUtils; |
8 | 11 |
|
9 | 12 |
public class LowercaseClustering extends AbstractClusteringFunction { |
... | ... | |
13 | 16 |
} |
14 | 17 |
|
15 | 18 |
@Override |
19 |
public Collection<String> apply(List<Field> fields) { |
|
20 |
Collection<String> c = Sets.newLinkedHashSet(); |
|
21 |
for(Field f : fields) { |
|
22 |
c.addAll(doApply(f.stringValue())); |
|
23 |
} |
|
24 |
return c; |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
16 | 28 |
protected Collection<String> doApply(final String s) { |
17 | 29 |
if(StringUtils.isBlank(s)) { |
18 | 30 |
return Lists.newArrayList(); |
Also available in: Unified diff
skip the normalization applied to the input string