Last active
April 17, 2016 23:24
-
-
Save JonathanZWhite/5f59770617e3345e62c7cd2e1e200dd2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InputParser { | |
isAskingForGenreList(text) { | |
const pattern = /music|recommendation/i | |
return text.match(pattern) | |
} | |
isAskingForNumberOfRec(text, prevCommand) { | |
return prevCommand === commands.GET_GENRE_LIST | |
} | |
isAskingForRecommendation(text, prevCommand) { | |
return prevCommand === commands.SET_NUMBER_OF_REC | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment