Skip to main content
added 69 characters in body
Source Link

Prototype is a good way, in alternative this is the pattern I use:

var QueryPreprocessing = {

  init: function () {
      return this;
  },    // set config variables for closures here
      var initparam = 'whatever';

      return {

          removeStopWords: function (query) {
              //code here
          },

          stemmer: function (w) {
              //code here
          },

          convertBoolean: function (w) {
              //code here
          }
    }

}

var qp = QueryPreprocessing.init();
qp.removeStopWord('thequerystring');
//...

Prototype is a good way, in alternative this is the pattern I use:

var QueryPreprocessing = {

  init: function () {
      return this;
  },

  removeStopWords: function (query) {
      //code here
  },

  stemmer: function (w) {
      //code here
  },

  convertBoolean: function (w) {
      //code here
  }

}

var qp = QueryPreprocessing.init();
qp.removeStopWord('thequerystring');
//...

Prototype is a good way, in alternative this is the pattern I use:

var QueryPreprocessing = {

  init: function () {
       
      // set config variables for closures here
      var initparam = 'whatever';

      return {

          removeStopWords: function (query) {
              //code here
          },

          stemmer: function (w) {
              //code here
          },

          convertBoolean: function (w) {
              //code here
          }
    }

}

var qp = QueryPreprocessing.init();
qp.removeStopWord('thequerystring');
//...
Source Link

Prototype is a good way, in alternative this is the pattern I use:

var QueryPreprocessing = {

  init: function () {
      return this;
  },

  removeStopWords: function (query) {
      //code here
  },

  stemmer: function (w) {
      //code here
  },

  convertBoolean: function (w) {
      //code here
  }

}

var qp = QueryPreprocessing.init();
qp.removeStopWord('thequerystring');
//...