org.carrot2.text.preprocessing
Class LabelFormatter

java.lang.Object
  extended by org.carrot2.text.preprocessing.LabelFormatter

public class LabelFormatter
extends Object

Formats cluster labels for final rendering.


Constructor Summary
LabelFormatter()
           
 
Method Summary
static String format(char[][] image, boolean[] stopWord, boolean joinWithSpace)
          A method for formatting cluster labels that is not coupled to PreprocessingContext.allLabels and can be used in algorithms that do not use the full preprocessing pipeline.
 String format(PreprocessingContext context, int featureIndex)
          Formats a cluster label for final rendering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelFormatter

public LabelFormatter()
Method Detail

format

public String format(PreprocessingContext context,
                     int featureIndex)
Formats a cluster label for final rendering.


format

public static String format(char[][] image,
                            boolean[] stopWord,
                            boolean joinWithSpace)
A method for formatting cluster labels that is not coupled to PreprocessingContext.allLabels and can be used in algorithms that do not use the full preprocessing pipeline.

Parameters:
image - images of the words making the label.
stopWord - determines whether the corresponding word of the label is a stop word
joinWithSpace - if true, label tokens will be joined with a space character, if false, no extra characters will be inserted between label tokens.


Copyright (c) Dawid Weiss, Stanislaw Osinski