Skip to content

Commit

Permalink
More duplicate code removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
akavlie committed Jun 1, 2012
1 parent 73503a8 commit caaa733
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions controllers/AnalysisController.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,3 @@ exports.controller = function (req, res) {
// end /analysis/analyze

}

if (!String.prototype.remove_urls) {
String.prototype.remove_urls = function () {
var url_pattern = /\(?\bhttps?:\/\/[-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#\/%=~_()|]/gi;
return this.replace(url_pattern, "");
}
}
if (!String.prototype.remove_hashtags) {
String.prototype.remove_hashtags = function () {
var hash_pattern = /(^|\s)#[-A-Za-z0-9_]+(\s|$)/gi;
return this.replace(hash_pattern, "$1$2");
}
}
if (!String.prototype.remove_screen_names) {
String.prototype.remove_screen_names = function () {
var at_pattern = /(^|\s)@[-A-Za-z0-9_]+(\s|$)/gi;
return this.replace(at_pattern, "$1$2");
}
}
if (!String.prototype.replace_punctuation) {
String.prototype.replace_punctuation = function () {
var alpha_pattern = /[^a-z^A-Z^0-9^-^_]/gi;
return this.replace(alpha_pattern, " ");
}
}

0 comments on commit caaa733

Please sign in to comment.