markov_dart 0.1.0 copy "markov_dart: ^0.1.0" to clipboard
markov_dart: ^0.1.0 copied to clipboard

outdatedDart 1 only

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

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
likes
40
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

More

Packages that depend on markov_dart