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

Force "I should go/be vegan" phrase to be at the start of a tweet #13

Merged
merged 1 commit into from
Nov 3, 2015
Merged
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
3 changes: 2 additions & 1 deletion filters/english.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var robustRegex = function(regexStr, flags) {
module.exports = [
robustRegex( "help me (be( a)?|become( a)?|go) #?vegan" ),
robustRegex( "i (" + adverbsRegexSet + ")? ?(want to|wanna|would like to) (be( a)?|become( a)?|go) #?vegan" ),
robustRegex( "i (" + adverbsRegexSet + ")? ?(should) (go|be) #?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"
robustRegex( "^(i think)? ?i (" + adverbsRegexSet + ")? ?(should) (go|be) #?vegan" ),
robustRegex( "i (" + adverbsRegexSet + ")? ?(will|do)? ?(need|want) help (going|becoming( a)?|being( a)?|staying( a)?) #?vegan" ),
robustRegex( "i (" + adverbsRegexSet + ")? ?(want to|wanna|would like to|should) (try) (going|becoming( a)?|being( a)?) #?vegan" ),
robustRegex( "i('| a)?m (considering|thinking (about|of)|mulling over) (going|becoming( a)?|being( a)?) #?vegan" ),
Expand Down
1 change: 1 addition & 0 deletions test/test-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var matches = [
var falsePositives = [
"I do not want to go vegan",
"I should be a vegan", // this phrasing more than likely isn't about going vegan long-term (e.g. I should be a vegan for Halloween)
"Don't tell me I should go vegan",
];

exports.matches = function(test) {
Expand Down