public class CategoryClusterManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.util.Set<Category> |
findCluster(Category cat,
java.util.Map<java.lang.String,java.util.Set<Category>> clusterMap)
Returns the cluster containing the given category.
|
java.util.Map<java.lang.String,java.util.Set<Category>> |
getClusterMap(Category root,
float similarity,
org.apache.lucene.search.spell.StringDistance sd)
Returns a set of cluster of similar categories.
|
static CategoryClusterManager |
getInstance() |
public static CategoryClusterManager getInstance()
public java.util.Map<java.lang.String,java.util.Set<Category>> getClusterMap(Category root, float similarity, org.apache.lucene.search.spell.StringDistance sd)
root
- the root of categories to clusterize.similarity
- a float between 0 and 1 based on how similar the specified category are to one another (1 = exact match after String cleaning (lower-case, no accent, ...)sd
- the StringDistance algorithm used to compute similarity (when similarity is < 1).public java.util.Set<Category> findCluster(Category cat, java.util.Map<java.lang.String,java.util.Set<Category>> clusterMap)
cat
- the categoryclusterMap
- the map of cluster.Copyright © 2001-2021 Jalios SA. All Rights Reserved.