2017 © Pedro Peláez
 

library oxfordapi-wrapper

A PHP/Laravel Wrapper for oxford dictionary API

image

inani/oxfordapi-wrapper

A PHP/Laravel Wrapper for oxford dictionary API

  • Wednesday, February 22, 2017
  • by akiyamaSM
  • Repository
  • 4 Watchers
  • 11 Stars
  • 647 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 719 % Grown

The README.md

oxfordapi-wrapper

A PHP/Laravel Wrapper for oxford dictionary API, (*1)

Installation

First, install the package through Composer., (*2)

composer require inani/oxfordapi-wrapper

Then include the service provider inside config/app.php., (*3)

'providers' => [
    ...
    Inani\OxfordApiWrapper\OxfordWrapperServiceProvider::class,
    ...
];

At least set up in the env file, (*4)

OXFORD_API_BASE_URI = 
OXFORD_APP_ID = 
OXFORD_APP_KEY = 

make a new instance, (*5)

// Make it or pass it as argument
$oxford = app(Inani\OxfordApiWrapper\OxfordWrapper::class);

How to use

Translation

// look for the translation from a language to an other, returns a parser
$parser =$oxford->lookFor('balablabla')
                ->from('en')
                ->to('es')
                ->translate();

// get array of translations
$translations = $parser->get();

// get array of [example => [translations]]
$examples = $parser->getExamples();

Definitions

// look for the definitions of a word, returns a parser
$parser =$oxford->lookFor('balablabla')
                ->define();

// get array of definitions
$definitions = $parser->get();

Examples

// look for the examples of a word, returns a parser
$parser =$oxford->lookFor('balablabla')
                ->examples();

// get array of examples
$definitions = $parser->get();

Thesaurus

// You can try all combinations
$res = $oxford->lookFor('happy')
               ->synonym()
               ->antonym()
               ->fetch();

// results will be related to (syno or anto)
// get synonyms and/or antonyms 
$res->get();
// get only antonyms or null if not specfied in fetch
$res->antonyms();
//get only synonyms or null if not specfied in fetch
$res->synonyms();

Phonetics


$res = $oxford->lookFor('ace') ->talk(); // get the array of result $res->get(); // get the link to the audio file of pronunciation $res->speak(); //get the spelling $res->spell(); //get the notation $res->notation();

The Versions

22/02 2017

dev-master

9999999-dev

A PHP/Laravel Wrapper for oxford dictionary API

  Sources   Download

MIT

The Requires

 

by Inani El Houssain

laravel guzzle oxford dictionary

22/02 2017

1.1.0

1.1.0.0

A PHP/Laravel Wrapper for oxford dictionary API

  Sources   Download

MIT

The Requires

 

by Inani El Houssain

laravel guzzle oxford dictionary

19/01 2017

1.0

1.0.0.0

A PHP/Laravel Wrapper for oxford dictionary API

  Sources   Download

MIT

The Requires

 

by Inani El Houssain

laravel guzzle oxford dictionary

19/01 2017

dev-Thesaurus

dev-Thesaurus

A PHP/Laravel Wrapper for oxford dictionary API

  Sources   Download

MIT

The Requires

 

by Inani El Houssain

laravel guzzle oxford dictionary