markov-strings
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -13,3 +13,3 @@ 'use strict'; | ||
constructor(data, options = {}) { | ||
this.data = this.formatData(data); | ||
this.data = data; | ||
@@ -61,2 +61,4 @@ this.corpus = undefined; | ||
this.data = this.formatData(this.data); | ||
this.corpus = {}; | ||
@@ -138,3 +140,4 @@ this.data.forEach(item => { | ||
// Loop to build sentence | ||
while (true) { | ||
let limit = 0; | ||
while (limit < max) { | ||
const block = arr[arr.length - 1]; // Last value in array | ||
@@ -159,2 +162,3 @@ const state = _.sample(corpus[block.words]); | ||
} | ||
limit++; | ||
} | ||
@@ -161,0 +165,0 @@ const scorePerWord = parseInt(score / arr.length); |
{ | ||
"name": "markov-strings", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "A Markov string generator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -218,2 +218,10 @@ [![Build Status](https://travis-ci.org/scambier/markov-strings.svg?branch=master)](https://travis-ci.org/scambier/markov-strings) | ||
### 1.3.2 | ||
- Fixed an infinite loop bug | ||
- Performance improvement | ||
### 1.3.1 | ||
- Updated README example | ||
- Removed a useless line | ||
### 1.3.0 | ||
@@ -220,0 +228,0 @@ - New feature: the generator now accepts arrays of objects, and tells the user which objects were used to build a sentence |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20069
328
233