markov_dart 0.1.0

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

markov_dart

A dart library for creating markov chains inspired by otac0n/markov.

Usage

A simple usage example:

import 'package:markov_dart/markov_dart.dart';

main() {
  var _chain = new MarkovChain<String>(1);

  var items = [
    ["This", "is", "a", "simple", "markov", "chain"],
    ["This", "is", "some", "simple", "magic"],
    ["This", "is", "a", "wild", "ride"]
  ];

  _chain.add(items[0]);
  _chain.add(items[1]);
  _chain.add(items[2]);

  print(_chain.chain(["This"]));

  // generated examples:
  // (is, some, simple, markov, chain)
  // (is, a, simple, magic)
  // (is, a, wild, ride)
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.1.0

  • Initial version

example/markov_dart_example.dart

// Copyright (c) 2017, 'rinukkusu'. 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:markov_dart/markov_dart.dart';

main() {
  var _chain = new MarkovChain<String>(1);

  var items = [
    ["This", "is", "a", "simple", "markov", "chain"],
    ["This", "is", "some", "simple", "magic"],
    ["This", "is", "a", "wild", "ride"]
  ];

  _chain.add(items[0]);
  _chain.add(items[1]);
  _chain.add(items[2]);

  print(_chain.chain(["This"]));

  // generated examples:
  // (is, some, simple, markov, chain)
  // (is, a, simple, magic)
  // (is, a, wild, ride)
}

1. Depend on it

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


dependencies:
  markov_dart: "^0.1.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:markov_dart/markov_dart.dart';
        
Version Uploaded Documentation Archive
0.1.0 Apr 20, 2017 Go to the documentation of markov_dart 0.1.0 Download markov_dart 0.1.0 archive

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

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

Platforms

Detected platforms:

Error(s) prevent platform classification.

Suggestions

  • Fix lib/src/chainstate.dart.

    Strong-mode analysis of lib/src/chainstate.dart failed with the following error:

    line: 28 col: 3
    Invalid override. The type of 'ChainState.==' ('(ChainState<dynamic>) → bool') isn't a subtype of 'Object.==' ('(dynamic) → bool').

  • Fix .analysis_options.

    We were unable to parse .analysis_options.

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

    analyzer:
      strong-mode: true
    

Dependencies

Package Constraint Resolved Available
Dev dependencies
test >=0.12.0 <0.13.0