Package org.carrot2.clustering
Interface ClusteringAlgorithm
-
- All Superinterfaces:
AcceptingVisitor
- All Known Implementing Classes:
BisectingKMeansClusteringAlgorithm,LingoClusteringAlgorithm,STCClusteringAlgorithm
public interface ClusteringAlgorithm extends AcceptingVisitor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T extends Document>
List<Cluster<T>>cluster(Stream<? extends T> documents, LanguageComponents languageComponents)Cluster a set of documents.default Set<Class<?>>optionalLanguageComponents()Set<Class<?>>requiredLanguageComponents()default booleansupports(LanguageComponents languageComponents)Verify whether a givenLanguageComponentsinstance contains all the required components for the algorithm to run.-
Methods inherited from interface org.carrot2.attrs.AcceptingVisitor
accept
-
-
-
-
Method Detail
-
requiredLanguageComponents
Set<Class<?>> requiredLanguageComponents()
- Returns:
- A set of classes required to be present in the
LanguageComponentsinstance provided for clustering.
-
optionalLanguageComponents
default Set<Class<?>> optionalLanguageComponents()
- Returns:
- A set of classes used by the algorithm, if present, but optional in
LanguageComponentsinstance provided for clustering.
-
supports
default boolean supports(LanguageComponents languageComponents)
Verify whether a givenLanguageComponentsinstance contains all the required components for the algorithm to run.- Parameters:
languageComponents-LanguageComponentsto check against.- Returns:
trueif the providedLanguageComponentsinstance is sufficient for clustering.
-
cluster
<T extends Document> List<Cluster<T>> cluster(Stream<? extends T> documents, LanguageComponents languageComponents)
Cluster a set of documents.- Type Parameters:
T- Any subclass ofDocument. Clusters of objects of the same type are returned.- Parameters:
documents- A stream ofdocumentsfor clustering.languageComponents-LanguageComponentswith a set of suppliers for the required language-specific components.- Returns:
- A list of top-level clusters (clusters can form a hierarchy via
Cluster.getClusters().
-
-