random_words 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 81

random_words

Build status

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.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.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
1.0.1 Apr 8, 2018 Go to the documentation of random_words 1.0.1 Download random_words 1.0.1 archive
1.0.0 Apr 8, 2018 Go to the documentation of random_words 1.0.0 Download random_words 1.0.0 archive

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
62 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
81
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • The description is too long.

    Search engines will display only the first part of the description. Try to keep it under 180 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Run dartfmt to format lib/random_words.dart.

    Run dartfmt to format lib/src/syllables/problematic.dart.

    Similar analysis of the following files failed:

    • lib/src/word_adjective.dart (hint)
    • lib/src/word_noun.dart (hint)
    • lib/src/words/adjectives_monosyllabic_safe.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0
string_scanner ^1.0.1 1.0.2
Transitive dependencies
charcode 1.1.1
path 1.6.1
source_span 1.4.0
Dev dependencies
benchmark_harness ^1.0.4
test >=0.12.20 <0.13.0