Class CategoryClusterManager


  • public class CategoryClusterManager
    extends java.lang.Object
    • Method Detail

      • 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 category
        clusterMap - the map of cluster.
        Returns:
        the cluster containing the given category.
        Since:
        jcms-10.0.4