Methods

  • BrainJS: u.method()
  • BrainXML: <u>method()</u>
function User( ) {
this.pushReview = function(dialog) {
  
     if (dialog) {
       if (this.reviewsNew.indexOf(dialog) === -1) {
         this.reviewsNew.push(dialog);
       }
     }
  
};
this.qna = function(query) {
     query = encodeURIComponent (query);
     var url = 'http://brainshop.ai/api/ma/'+query;
     return sraix(url);
  
};
this.r = function(text, seperator) {
  
     return random(text, seperator);
  
};
this.r2ap = function(title) {
    
     return this.relation2accusativePronoun(title);
  
};
this.r2p = function(relation) {
     return this.relation2Pronoun(relation);
  
};
this.r2pp = function(title) {
    
     return this.relation2PossessivePronoun(title);
  
};
this.random = function(text, seperator) {
  
     if (seperator === undefined) {
       seperator = '';
     }
     var items = text.split(seperator);
     var max = items.length + 1;
     var i = Math.floor((Math.random() * max)); 
     return items[i];
  
};
this.randomString = function(len) {
  
     if (!len){
       len = 16;
     }
   	var chars = "0123456789aBCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
   	var randomstring = '';
   	for (var i=0; i          
this.relation2AccusativePronoun = function(title) {
    
     if (!title) {
       return '';
     }
     var pronoun = this.relation2Pronoun(title);
     return this.p2ap(pronoun);
  
};
this.relation2PossessivePronoun = function(title) {
    
     if (!title) {
       return '';
     }
     var pronoun = this.relation2Pronoun(title);
     return this.p2pp(pronoun);
  
};

Pages