org.carrot2.clustering.synthetic
Class ByFieldClusteringAlgorithmDescriptor.AttributeBuilder

java.lang.Object
  extended by org.carrot2.clustering.synthetic.ByFieldClusteringAlgorithmDescriptor.AttributeBuilder
Enclosing class:
ByFieldClusteringAlgorithmDescriptor

public static class ByFieldClusteringAlgorithmDescriptor.AttributeBuilder
extends Object

Attribute map builder for the ByFieldClusteringAlgorithm component. You can use this builder as a type-safe alternative to populating the attribute map using attribute keys.


Field Summary
 Map<String,Object> map
          The attribute map populated by this builder.
 
Constructor Summary
protected ByFieldClusteringAlgorithmDescriptor.AttributeBuilder(Map<String,Object> map)
          Creates a builder backed by the provided map.
 
Method Summary
 List<Cluster> clusters()
          Clusters created by the algorithm.
 ByFieldClusteringAlgorithmDescriptor.AttributeBuilder documents(List<Document> value)
          Documents to cluster.
 ByFieldClusteringAlgorithmDescriptor.AttributeBuilder fieldName(String value)
          Name of the field to cluster by.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

public final Map<String,Object> map
The attribute map populated by this builder.

Constructor Detail

ByFieldClusteringAlgorithmDescriptor.AttributeBuilder

protected ByFieldClusteringAlgorithmDescriptor.AttributeBuilder(Map<String,Object> map)
Creates a builder backed by the provided map.

Method Detail

documents

public ByFieldClusteringAlgorithmDescriptor.AttributeBuilder documents(List<Document> value)
Documents to cluster.

See Also:
ByFieldClusteringAlgorithm.documents

clusters

public List<Cluster> clusters()
Clusters created by the algorithm.

See Also:
ByFieldClusteringAlgorithm.clusters

fieldName

public ByFieldClusteringAlgorithmDescriptor.AttributeBuilder fieldName(String value)
Name of the field to cluster by. Each non-null scalar field value with distinct hash code will give rise to a single cluster, named using the value returned by ByFieldClusteringAlgorithm.buildClusterLabel(Object). If the field value is a collection, the document will be assigned to all clusters corresponding to the values in the collection. Note that arrays will not be 'unfolded' in this way.

See Also:
ByFieldClusteringAlgorithm.fieldName


Copyright (c) Dawid Weiss, Stanislaw Osinski