Package com.jalios.jcms.categorycleaner
Class CategoryClusterManager
- java.lang.Object
-
- com.jalios.jcms.categorycleaner.CategoryClusterManager
-
public class CategoryClusterManager extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Method Detail
-
getInstance
public static CategoryClusterManager getInstance()
-
getClusterMap
public 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.- Parameters:
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).- Returns:
- a set of cluster of similar categories.
- Since:
- jcms-10.0.4
-
findCluster
public 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.- Parameters:
cat
- the categoryclusterMap
- the map of cluster.- Returns:
- the cluster containing the given category.
- Since:
- jcms-10.0.4
-
-