Class: CrossLanguageSpotter::CrossLanguageReferencesProducerMethodsComparator

Inherits:
Object
  • Object
show all
Defined in:
lib/crosslanguagespotter/figures_evaluator.rb

Overview

It compare different methods, each methods can be instantiated different times using different parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gold_set, project) ⇒ CrossLanguageReferencesProducerMethodsComparator

Returns a new instance of CrossLanguageReferencesProducerMethodsComparator.



20
21
22
23
24
# File 'lib/crosslanguagespotter/figures_evaluator.rb', line 20

def initialize(gold_set,project)
    @gold_set = gold_set
    @results = Hash.new {|h,k| h[k]={}}
    @project = project
end

Instance Attribute Details

#resultsObject (readonly)

map per class, per params of the figures obtained agains the given gold set



18
19
20
# File 'lib/crosslanguagespotter/figures_evaluator.rb', line 18

def results
  @results
end

Instance Method Details

#add(clazz, parameters) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/crosslanguagespotter/figures_evaluator.rb', line 26

def add(clazz,parameters)
    producer = clazz.new(parameters)
    observed_set = producer.produce_set(@project)
    fe = FiguresEvaluator.new(@gold_set,observed_set)
    result = fe.all_figures
    @results[clazz][parameters] = result
    result
end