Git Product home page Git Product logo

oxford-dictionary-dart's Introduction

Oxford Dictionary API Wrapper in Dart

The package is under development and doesn't have all API functionality. Feel free to contribute!

The Oxford Dictionaries API offers an easy way to access powerful lexical data (words, definitions, translations, audio pronunciations, synonyms, antonyms, parts of speech, and more) to use in your apps and websites.

To test package soundness there was 100 requests saved with according responses in test/fixtures/{entries,lemmas}/ folders. If you encounter any null value error please open an issue in repository Issues page.

See Contribution guidelines for this project

Read Oxford Dictionaries Documentation

Getting Started

git clone [email protected]:rIIh/oxford-dictionary.git && cd oxford-dictionary
flutter pub get
flutter pub run build_runner build

How to use

See example for more usecase information.

void main() async {
  final dictionary = OxfordDictionary(
    'en',
    Platform.environment['APP_ID'],
    Platform.environment['APP_KEY'],
  );

  // get word definition entry
  final word = await dictionary.entries.search(wordString);

  // get phrases
  final phrases = word.phrases.values.map((phrases) => phrases).expand((phrases) => phrases).toList();

  // get pronunciations
  final pronunciations = word.variants.values
      .map((e) => e.map((e) => e.pronunciations))
      .expand((pronunciations) => pronunciations)
      .toList();

  // get senses
  final senses = word.variants.values
      .map((variants) => variants?.map((variant) => variant.senses))
      .expand((senses) => senses)
      .toList();

  // get definitions
  final definitions = senses.map((e) => e.map((e) => e.definitions)).expand((definitions) => definitions).toList();

  // get sub senses
  final subSenses = senses.map((e) => e.map((e) => e.subSenses)).expand((subSenses) => subSenses).toList();
}

oxford-dictionary-dart's People

Contributors

riih avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

fossabot

oxford-dictionary-dart's Issues

http version

Hey! Can you please change the http dependency to 13.0.0? I am building an app that requires the googleapis package which has http 13.0.0 dependency.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.