random_words 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

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]
81
Health:
Code health derived from static analysis. [more]
77
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
59
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Jan 20, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

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

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

line 22 col 17: Unnecessary new keyword.

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 86 col 22: Unnecessary new keyword.

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

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

line 20 col 17: Unnecessary new keyword.

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 75 col 23: Unnecessary new keyword.

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

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

line 20 col 17: Unnecessary new keyword.

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 75 col 18: Unnecessary new keyword.

Fix additional 12 files with analysis or formatting issues. (-10.45 points)

Additional issues in the following files:

  • lib/src/syllables.dart (5 hints)
  • lib/src/syllables/disyllabic.dart (5 hints)
  • lib/src/syllables/monosyllabic.dart (3 hints)
  • lib/src/words/unsafe.dart (2 hints)
  • lib/src/syllables/trisyllabic.dart (1 hint)
  • lib/src/words/adjectives.dart (1 hint)
  • lib/src/words/adjectives_monosyllabic_safe.dart (1 hint)
  • lib/src/words/all.dart (1 hint)
  • lib/src/words/nouns.dart (1 hint)
  • lib/src/words/nouns_monosyllabic_safe.dart (1 hint)
  • 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.)

Maintenance suggestions

Package is getting outdated. (-37.81 points)

The package was last published 71 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
collection 1.14.12
meta 1.1.8
path 1.6.4
source_span 1.6.0
term_glyph 1.1.0
Dev dependencies
benchmark_harness ^1.0.4
test ^1.0.0