dist/jst9.js
function predict(word, amount) {

    if (!word) {
      return [];
    }

    amount = amount || this.config.maxAmount;

    var currentWord = false;

    var initialBranchResult = this._findInitialBranch(word);

    if(!initialBranchResult) {
      return [];
    }

    if (initialBranchResult.currentBranch.$ === true) {
      currentWord = initialBranchResult.baseWord;
    }

    var predictedList = this._exploreBranch(initialBranchResult.baseWord, initialBranchResult.currentBranch);

    if (currentWord) {
      predictedList.push(currentWord);
    }

    predictedList.sort(this.config.sort);

    return predictedList.slice(0, amount);
  }
function predict(word, amount) {

    if (!word) {
      return [];
    }

    amount = amount || this.config.maxAmount;

    var currentWord = false;

    var initialBranchResult = this._findInitialBranch(word);

    if(!initialBranchResult) {
      return [];
    }

    if (initialBranchResult.currentBranch.$ === true) {
      currentWord = initialBranchResult.baseWord;
    }

    var predictedList = this._exploreBranch(initialBranchResult.baseWord, initialBranchResult.currentBranch);

    if (currentWord) {
      predictedList.push(currentWord);
    }

    predictedList.sort(this.config.sort);

    return predictedList.slice(0, amount);
  }
function predict ( word , amount ) { if ( ! word ) { return [ ] ; } amount = amount || this . config . maxAmount ; var currentWord = false ; var initialBranchResult = this . _findInitialBranch ( word ) ; if ( ! initialBranchResult ) { return [ ] ; } if ( initialBranchResult . currentBranch . $ === true ) { currentWord = initialBranchResult . baseWord ; } var predictedList = this . _exploreBranch ( initialBranchResult . baseWord , initialBranchResult . currentBranch ) ; if ( currentWord ) { predictedList . push ( currentWord ) ; } predictedList . sort ( this . config . sort ) ; return predictedList . slice ( 0 , amount ) ; }
Predict the words, given the initial word
@param  {String} word The initial word
@return {Array}      The array of Strings with the predicted words
Predict the words given the initial word