src/index.js
/**
     * Sets a word, or a function that returns a word, to start the sentence with.
     *
     * @param {startFn|string} fnOrStr a word, or a function that returns a word, to start the sentence with
     * @return {Markovski}
     */
Sets a word, or a function that returns a word, to start the sentence with.
@param {startFn|string} fnOrStr a word, or a function that returns a word, to start the sentence with
@return {Markovski}
Sets a word or a function that returns a word to start the sentence with . @param { startFn|string } fnOrStr a word or a function that returns a word to start the sentence with @return { Markovski }
startWith(fnOrStr) {
        if (typeof fnOrStr === "string") {
            this._startWith = () => fnOrStr;
        } else if (typeof fnOrStr === "function") {
            this._startWith = model => fnOrStr(model);
        } else {
            throw new Error("Argument must be a function or a string");
        }
        return this;
    }
startWith ( fnOrStr ) { if ( typeof fnOrStr === "string" ) { this . _startWith = ( ) => fnOrStr ; } else if ( typeof fnOrStr === "function" ) { this . _startWith = model => fnOrStr ( model ) ; } else { throw new Error ( "Argument must be a function or a string" ) ; } return this ; }
Sets a word, or a function that returns a word, to start the sentence with.
Sets a word or a function that returns a word to start the sentence with .