greg
greg copied to clipboard
Count between 2 and 33 instead of 34
It is currently possible to generate random sentences which are not the same but have the same id when parsed. Example:
exports = require('greg');
var phrase1 = '34 cute rabbits sang jovially',
phrase2 = '2 dapper rabbits sang jovially';
exports.parse(phrase1) === exports.parse(phrase2); // true, both 34.
Updating the count to have a range from 2 to 33 instead of 2 to 34 fixes this.
Thanks @josher19, I'm not sure of the benefit of the fromId
and confirm
functions -- would you care to elaborate? I actually got a longer list of words from "the" Greg, along with (part of) his implementation. I haven't added the words out of laziness, but I probably should.