Skip to content

Commit

Permalink
Added a directory for checks from Fowler's. Added a check for 'waxed …
Browse files Browse the repository at this point in the history
…lyrically' &c.
  • Loading branch information
tkmharris committed Mar 14, 2016
1 parent c6f3141 commit e4166fa
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions proselint/checks/fowlers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Advice from Fowler's Modern English Usage."""
54 changes: 54 additions & 0 deletions proselint/checks/fowlers/waxed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Waxed lyrical.
---
layout: post
source: Fowler's Modern English Usage
source_url: bit.ly/1YBG8QJ
title: Waxed lyrical
date: 2016-03-10 14:48:42
categories: writing
---
Fowler's says:
It's primary meaning 'grow larger, increase' (as opposed to 'wane') leads
naturally to the sense 'pass into a specified state or mood, begin to use a
specified tone. In this meaning a following modifier must be an adj. not an
adverb ('He waxed enthusiastic [not enthusiastically] about Australia').
"""
from proselint.tools import memoize, preferred_forms_check


@memoize
def check(text):
"""Suggest the preferred forms."""
err = "fowlers.waxed"
msg = u"The modifier following 'waxed' must be an adj.: '{}' is correct"

waxes = ["wax", "waxes", "waxed", "waxing"]
modifiers = [("ebullient", "ebulliently"),
("ecstatic", "ecstatically"),
("eloquent", "eloquently"),
("enthusiastic", "enthusiastically"),
("euphoric", "euphorically"),
("indignant", "indignantly"),
("lyrical", "lyrically"),
("melancholic", "melancholically"),
("metaphorical", "metaphorically"),
("nostalgic", "nostalgically"),
("patriotic", "patriotically"),
("philosophical", "philosophically"),
("poetic", "poetically"),
("rhapsodic", "rhapsodically"),
("romantic", "romantically"),
("sentimental", "sentimentally")
]

def pairs(word):
return [[word + ' ' + pair[0], [word + ' ' + pair[1]]]
for pair in modifiers]

preferred = []
for word in waxes:
preferred += pairs(word)

return preferred_forms_check(text, preferred, err, msg)

0 comments on commit e4166fa

Please sign in to comment.