Skip to content

Instantly share code, notes, and snippets.

@bmuller
Created January 31, 2012 15:11
Show Gist options
  • Select an option

  • Save bmuller/1710988 to your computer and use it in GitHub Desktop.

Select an option

Save bmuller/1710988 to your computer and use it in GitHub Desktop.
execuspeak detector
def detect_executive(resume)
words = resume.downcase.scan(/[a-z0-9#]+/i)
corporatespeak = { :budget => 'budget', :revenue => 'revenue', :strategy => 'strateg', :seo => 'seo', :sem => 'sem', :enable => 'enable', :service => 'service', :analytics => 'analy', :consulting => 'consult', :directing => 'direct', :enterprise => 'enterpris', :media => 'media', :empower => 'empower', :lead => 'lead', :plan => 'plan', :executive => 'executive' }
counts = {}
corporatespeak.each { |title, match|
counts[title] = words.select { |w| w.include? match }.count
}
puts "Word Counts:"
score = 0
counts.select { |k,v| v > 1 }.each { |k,v| puts "#{k}: #{v}"; score += v }
puts "\nScore: #{score} (#{[score, 100].min}% probability an executive)"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment