Class CategoryClusterManager

java.lang.Object
com.jalios.jcms.categorycleaner.CategoryClusterManager

public class CategoryClusterManager extends Object
  • Method Details

    • getInstance

      public static CategoryClusterManager getInstance()
    • getClusterMap

      public Map<String,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 Set<Category> findCluster(Category cat, Map<String,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