Gibberish Detector API - Ruby Gem

Gibberish Detector analyzes text using bigram frequency and vowel ratios to identify nonsensical or randomly generated content.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_gibberishdetector'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_gibberishdetector

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_gibberishdetector'

# Initialize the client
client = APIVerve::Gibberishdetector::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({ text: "The quick brown fox jumps over the lazy dog" })

# Print the response
puts response

Error Handling

begin
  response = client.execute({ text: "The quick brown fox jumps over the lazy dog" })
  puts response["data"]
rescue APIVerve::Gibberishdetector::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Gibberishdetector::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Gibberishdetector::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "isGibberish": false,
    "score": 0.12,
    "confidence": 88,
    "confidenceLevel": "high",
    "text": "The quick brown fox jumps over the lazy dog",
    "textLength": 43,
    "wordCount": 9
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.