Class: PdfExtract::Names::NamesService

Inherits:
Object
  • Object
show all
Defined in:
lib/names.rb

Class Method Summary collapse

Class Method Details

.detect_names(content) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/names.rb', line 52

def self.detect_names content
  data = {:name_frequency => 0.0}
  begin
    response = Net::HTTP.start "names.crrd.dyndns.org" do |http|
      http.post "/detect", content
    end
  
    if response.code == "200"
      data = JSON.parse response.body
    end
  rescue
  end
  data
end