A feature is something to be retrieved by the statistics.

ALL_FEATURES

interface Feature<T extends FeatureInfo> {
    description: string;
    initialValue: T;
    name: string;
    postProcess?: (
        featureRoot: string,
        info: Map<string, FeatureStatisticsWithMeta>,
        outputPath: string,
        config: StatisticsSummarizerConfiguration,
    ) => void;
    process: FeatureProcessor<T>;
}

Type Parameters

  • T extends FeatureInfo

    The type of what should be collected for the feature

Properties

description: string

A description of the feature

initialValue: T

Values to start the existing track from

name: string

A descriptive, yet unique name of the feature

postProcess?: (
    featureRoot: string,
    info: Map<string, FeatureStatisticsWithMeta>,
    outputPath: string,
    config: StatisticsSummarizerConfiguration,
) => void

If present, this feature allows to post-process the results of the feature extraction (for the summarizer).

The extraction can use the output path to write files to, and should return the final output.

Type declaration

    • (
          featureRoot: string,
          info: Map<string, FeatureStatisticsWithMeta>,
          outputPath: string,
          config: StatisticsSummarizerConfiguration,
      ): void
    • Parameters

      • featureRoot: string

        The root path to the feature directory which should contain all the files the feature can write to (already merged for every file processed)

      • info: Map<string, FeatureStatisticsWithMeta>

        The feature statistic maps each file name/context encountered to the feature information as well as the meta statistics for the file

      • outputPath: string

        The path to write the output to (besides what is collected in the output and meta information)

      • config: StatisticsSummarizerConfiguration

        The configuration for the summarizer (e.g., to obtain the number of folders to skip for the feature root)

      Returns void

A function that retrieves the feature in the document appends it to the existing feature set (we could use a monoid :D), the filepath corresponds to the active file (if any)