random_words 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

random_words #

Build status pub package

Utilities for generating random English words. It gives the option to retrieve random Nouns and Adjectives along with WordPairs. It is based off of Filip Hracek's english_words plugin

Usage #

Printing the top 50 most used nouns in the English language:

import 'package:random_words/random_words.dart';

main() {
  nouns.take(50).forEach(print);
}

Computing number of syllables in a word:

syllables('beautiful');  // 3
syllables('abatement');  // 3
syllables('zoology');  // 4

Generating 5 interesting 2-syllable word combinations:

generateWordPairs().take(5).forEach(print);

Generate 10 random adjectives:

generateAdjective().take(10).forEach(print);

Generate 10 random nouns:

generateNoun().take(10).forEach(print);

Running Tests #

If you want to run the tests for this project under Flutter Dart

flutter pub pub run test

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.2 #

  • Bumped versions to support Dart 2

1.0.1 #

  • Added asCapitalized getter to noun and adjective to allow for nicer formatting of single words

1.0.0 #

  • Initial version

example/random_words_example.dart

// Copyright (c) 2017, filiph. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:random_words/random_words.dart';

void main() {
  generateWordPairs().take(10).forEach(print);
  generateAdjective().take(10).forEach(print);
  generateNoun().take(10).forEach(print);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  random_words: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:random_words/random_words.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
84
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:random_words/random_words.dart.

Health suggestions

Fix lib/src/word_adjective.dart. (-2.96 points)

Analysis of lib/src/word_adjective.dart reported 6 hints, including:

line 37 col 22: Use = to separate a named parameter from its default value.

line 38 col 12: Use = to separate a named parameter from its default value.

line 39 col 18: Use = to separate a named parameter from its default value.

line 115 col 24: Use = to separate a named parameter from its default value.

line 116 col 14: Use = to separate a named parameter from its default value.

Fix lib/src/word_noun.dart. (-2.96 points)

Analysis of lib/src/word_noun.dart reported 6 hints, including:

line 37 col 22: Use = to separate a named parameter from its default value.

line 38 col 12: Use = to separate a named parameter from its default value.

line 39 col 18: Use = to separate a named parameter from its default value.

line 115 col 24: Use = to separate a named parameter from its default value.

line 116 col 14: Use = to separate a named parameter from its default value.

Fix lib/src/word_pair.dart. (-2.96 points)

Analysis of lib/src/word_pair.dart reported 6 hints, including:

line 42 col 22: Use = to separate a named parameter from its default value.

line 43 col 12: Use = to separate a named parameter from its default value.

line 44 col 18: Use = to separate a named parameter from its default value.

line 137 col 24: Use = to separate a named parameter from its default value.

line 138 col 14: Use = to separate a named parameter from its default value.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/random_words.dart (Run dartfmt to format lib/random_words.dart.)
  • lib/src/syllables/problematic.dart (Run dartfmt to format lib/src/syllables/problematic.dart.)
  • lib/src/words/adjectives_monosyllabic_safe.dart (Run dartfmt to format lib/src/words/adjectives_monosyllabic_safe.dart.)

Maintenance suggestions

Package is getting outdated. (-13.15 points)

The package was last published 59 weeks ago.

The description is too long. (-3 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <3.0.0
string_scanner ^1.0.1 1.0.5
Transitive dependencies
charcode 1.1.2
meta 1.1.7
path 1.6.4
source_span 1.5.5
term_glyph 1.1.0
Dev dependencies
benchmark_harness ^1.0.4
test ^1.0.0