Skip to content

Instantly share code, notes, and snippets.

@wflanagan
Created January 14, 2012 15:45
Show Gist options
  • Save wflanagan/1611834 to your computer and use it in GitHub Desktop.
Save wflanagan/1611834 to your computer and use it in GitHub Desktop.
term extraction
def term_extract
p4 = phrases(4)
p3 = phrases(3)
p3_delete_list = []
p4_keys = p4.keys
p3_keys = p3.keys
p4_keys.each do |pkey|
p3_keys.each do |check_key|
if pkey.include?(check_key)
p3_delete_list << check_key
end
end
end
p3.delete(p3_delete_list)
[p4, p3]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment