Top Level Namespace

Defined Under Namespace

Modules: DCI, Enumerable Classes: Hash, HeuristicRunner, Object, SavingHash, YamlLogger

Constant Summary collapse

EXTENSION_TYPES =
{
	:audio => %w(mp3 mp4 wav m4a wma flac aiff aac aif m3u mid midi mpa ra ram),
	:video => %w(mpg mpeg mp4 wmv avi flv mkv 3g2 3gp asf asx mov qt rm vob),
	:text => %w(txt pdf chm doc docx msg tex rtf),
	:image => %w(jpg bmp png tiff pcx psd eps gif indd jpeg mng psp svg tif),
	:code => %w(c cpp rb py h php java scala vb bas cs pl lua hs sml v erb),
	:compressed => %w(7z deb gz pkg rar sea sit sitx zip),
}
EXTENSION_TYPE_MAP =
Hash.new { |h,k| h[k] = [] }

Instance Method Summary collapse

Instance Method Details

#heuristic(name, &b) ⇒ Object



53
54
55
# File 'lib/dci/heuristics.rb', line 53

def heuristic name, &b
	$heuristics << [name.to_s,b]
end

#run_heuristics(tth, v) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/dci/heuristics.rb', line 43

def run_heuristics tth, v
	runner = HeuristicRunner.new tth, v
	$heuristics.each do |name,b|
		#puts "running #{name} on #{tth}"
		runner.ie &b
	end
	v[:terms].uniq!
	v[:texts].uniq!
end