dispense with vs swear off

dispense with

verb
  • To eliminate or do without. 

swear off

verb
  • To quit or cease completely, or to promise to quit, as a bad habit. 

How often have the words dispense with and swear off occurred in a corpus of books? (source: Google Ngram Viewer )