Skip to content
Snippets Groups Projects
Commit 847c7d33 authored by bfs15's avatar bfs15
Browse files

sort order fix, started wdf fun

parent c2ea6f32
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,22 @@ namespace :tag do
private
def tagWdfSorted()
tagWdf = []
Tag.all.each_with_index do |t,i|
tagWdf << [t.id, wdfSearch(t.name)]
end
tagWdf = tagWdf.sort_by { |t| t[1] }
return tagWdf
end
def wdfSearch(tname)
end
def merge(search_los, relevant_los)
merged_los = []
......@@ -172,8 +188,8 @@ namespace :tag do
end
merged_los.push(*relevant_los)
merged_los = merged_los.sort_by { |lo| lo[1] }
return merged_los.reverse.first(50)
merged_los = merged_los.sort_by { |lo| lo[1]*-1 }
return merged_los.first(50)
end
# hash[id1][id2] will equal how many times tags with id1 and id2 appear together on a LO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment