Acronym Expander API - Ruby Gem
Acronym Expander is an AI-powered tool for expanding acronyms to their full meanings. It uses a dictionary of common acronyms and AI for unknown ones, with optional context for better accuracy.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_acronymexpander'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_acronymexpander
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_acronymexpander'
# Initialize the client
client = APIVerve::Acronymexpander::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
acronym: "API",
context: "General"
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ acronym: "API", context: "General" })
puts response["data"]
rescue APIVerve::Acronymexpander::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Acronymexpander::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Acronymexpander::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"acronym": "API",
"expansions": [
{
"expansion": "Application Programming Interface",
"description": "A set of protocols for building software",
"category": "technology"
}
],
"most_common": {
"expansion": "Application Programming Interface",
"description": "A set of protocols for building software",
"category": "technology"
},
"source": "dictionary",
"context_provided": "software"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/acronymexpander?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.