Class: Broadlistening::Steps::Aggregation

Inherits:
BaseStep
  • Object
show all
Defined in:
lib/broadlistening/steps/aggregation.rb

Constant Summary collapse

CSV_FILENAME =
"final_result_with_comments.csv"

Instance Attribute Summary

Attributes inherited from BaseStep

#config, #context

Instance Method Summary collapse

Methods inherited from BaseStep

#initialize

Constructor Details

This class inherits a constructor from Broadlistening::Steps::BaseStep

Instance Method Details

#executeObject

Output format compatible with Kouchou-AI Python implementation



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/broadlistening/steps/aggregation.rb', line 11

def execute
  result = {
    arguments: build_arguments,
    clusters: build_clusters,
    comments: build_comments,
    propertyMap: build_property_map,
    translations: build_translations,
    overview: context.overview,
    config: config.to_h,
    comment_num: context.comments.size
  }

  context.result = result

  export_csv if config.is_pubcom && context.output_dir

  context
end