Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// stripArticles.js

(function() {
  /*global adventurejs A*/ 
  "use strict";

	var p = adventurejs.Parser.prototype;

  /**
   * <p>
   * Convert some common compound prepositions into single words
   * to streamline preposition handling.
   * </p>
   * @memberOf adventurejs.Parser
   * @method adventurejs.Parser#stripArticles
   * @param {String} input Player input.
   * @returns {String}
   */
   p.stripArticles = function Parser_stripArticles( parsed_input ) 
  {

		parsed_input = parsed_input.replace(/ the /g, " ");
		parsed_input = parsed_input.replace(/ a /g, " ");
		parsed_input = parsed_input.replace(/ an /g, " ");
		//input = input.replace(/ some /g, " ");

    this.game.log( "log", "high", "parseInput.js > stripArticles return: " + parsed_input, 'Parser' );
    return parsed_input;
  
  }

}());