Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REGEX to match people that would like to try and be vegan with co… #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions filters/english.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ track("vegan");
var adverbs = [
'really', 'totally', 'probably', 'defin[ia]tely', 'absolutely', 'actually',
'certainly', 'literally', 'legitimately', 'genuinely', 'honestly', 'truly',
'undoubtedly', 'unquestionably'
'undoubtedly', 'unquestionably', 'seriously', 'rly'
];
var adverbsRegexSet = adverbs.join('|');

Expand All @@ -18,7 +18,7 @@ var recidivismAdjectivesRegexSet = recidivismAdjectives.join('|');

module.exports = [
regex( "help me (be( a)?|become( a)?|go) #?vegan" ),
regex( "i (" + adverbsRegexSet + ")? ?(want to|wanna|would like to) (be( a)?|become( a)?|go) #?vegan" ),
regex( "i (" + adverbsRegexSet + ")? ?(want to|wanna|would like to)( try( to| and|))? (be( a)?|become( a)?|go|being) #?vegan" ),
// forcing this to be at the start of the tweet is a simple hack for excluding things like "don't tell me I should go vegan"
regex( "^(i think)? ?i (" + adverbsRegexSet + ")? ?(should) (go|be) #?vegan" ),
regex( "i (" + adverbsRegexSet + ")? ?(will|do)? ?(need|want) help (going|becoming( a)?|being( a)?|staying( a)?) #?vegan" ),
Expand Down
2 changes: 1 addition & 1 deletion lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ TweetFilter.prototype.tweetIsPrivateConvo = function(tweet) {
}

TweetFilter.prototype.tweetContainsMultipleMentions = function(tweet) {
return tweet.text.split('@').length - 1 > 1;
return tweet.text.split('@').length - 1 > 1;
}

TweetFilter.prototype.tweetIsEligable = function(tweet) {
Expand Down
3 changes: 3 additions & 0 deletions test/test-english.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ var matches = [
"\"i like to quote\" but i want to go vegan and \"stuff\"",
"i'm planning on going vegan",
"i'm totally thinking about becoming a vegan",
"i want to try and go vegan",
"i wanna try being vegan",
"i would like to try and be a vegan",
];

var falsePositives = [
Expand Down