openthesaurus 0.0.7 copy "openthesaurus: ^0.0.7" to clipboard
openthesaurus: ^0.0.7 copied to clipboard

A small dart library for querying synonyms from openthesaurus.de

openthesaurus-dart #

This is a simple dart library for accessing the openthesaurus api.

Get it through pub.dev #

...
dependencies:
  openthesaurus: <latest_version>

or

dart pub add openthesaurus

Usage #

Create an instance with


import 'package:openthesaurus/openthesaurus.dart';

var ot = OpenThesaurus.create();

and retrieve synonyms with

var synonyms = await ot.get('Hand');
for (var syn in synonyms) {
  print(syn.terms?.map((e) => e.term).toList());
}

Options #

Retrieve synonyms with options with

var response = ot.getWith('Hand', 
  similar: true,     // return similar terms
  startsWith: true,  // return terms that start with the query
  superSet: true,    // return generic terms
  subSet: true,      // return specific terms
  baseForm: true     // return base form of query term
);

var synonyms = response.synonymSet;
...
var similar = response.similarTerms;
...
var startsWithTerms = response.startsWithTerms;
...
var baseForms = responce.baseForms;

or more specifically

var response = ot.getWithSubString('Hand', 
  similar: true,     // return similar terms
  startsWith: true,  // return terms that start with the query
  superSet: true,    // return generic terms
  subSet: true,      // return specific terms
  baseForm: true     // return base form of query term
  from: 0,           // index of the substring to start
  max: 10            // maximum number of substring results
);

See the pub.dev API documentation for description of the parameters and return types.

0
likes
160
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

A small dart library for querying synonyms from openthesaurus.de

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

http, json_annotation

More

Packages that depend on openthesaurus