Created
January 31, 2012 15:11
-
-
Save bmuller/1710988 to your computer and use it in GitHub Desktop.
execuspeak detector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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