Advertisement
abhisekp

Grammar List

Oct 5th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var prepositions = ["on", "in", "at", "since", "for", "ago", "before", "to", "past", "to", "till", "until", "till", "until", "by", "in", "at", "on", "by, next to, beside", "under", "below", "over", "above", "across", "through", "to", "into", "towards", "onto", "from", "from", "of", "by", "on", "in", "off", "out of", "by", "at", "about"];
  2.  
  3. var articles = ["a", "an", "the"];
  4.  
  5.  
  6. var grammars = prepositions.concat(articles);
  7. var grammarRegex = new RegExp('\\b(' + grammars.join('|') +  ')\\b', 'gi');
  8. var redundantSpaceRegex = /\s+/g;
  9.  
  10. var quote = "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.";
  11. quote = quote.replace(regex, '').replace(redundantSpaceRegex, ' ').trim();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement