Debian Codegraph @

proselint/checks/terms/venery.py

raw
1 """Names for groups of animals.
2
3 ---
4 layout: post
5 source: Oxford Dictionaries
6 source_url: http://www.oxforddictionaries.com/words/what-do-you-call-a-group-of
7 title: Names for groups of animals
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Names for groups of animals.
13
14 """
15 from proselint.tools import memoize, preferred_forms_check
16
17
18 @memoize
19 def check(text):
20 """Check the text."""
21 err = "oxford.venery_terms"
22 msg = "The venery term is '{}'."
23
24 term_list = [
25 ["alligators", "congregation"],
26 ["antelopes", "herd"],
27 ["baboons", "troop"],
28 ["badgers", "cete"],
29 ["bats", "colony"],
30 ["bears", "sloth"],
31 ["buffalo", "herd"],
32 ["bullfinches", "bellowing"],
33 ["caribou", "herd"],
34 ["cats", "glaring"],
35 ["caterpillars", "army"],
36 ["cockroaches", "intrusion"],
37 ["coyotes", "pack"],
38 ["crows", "murder"],
39 ["dogs", "pack"],
40 ["eagles", "convocation"],
41 ["emus", "mob"],
42 ["flamingos", "stand"],
43 ["frogs", "army"],
44 ["goldfinches", "charm"],
45 ["gorillas", "band"],
46 ["guineafowl", "rasp"],
47 ["hedgehogs", "array"],
48 ["herons", "siege"],
49 ["hogs", "parcel"],
50 ["hyenas", "cackle"],
51 ["ibex", "herd"],
52 ["iguanas", "mess"],
53 ["lions", "pride"],
54 ["locusts", "plague"],
55 ["mackerel", "shoal"],
56 ["mares", "stud"],
57 ["minnows", "shoal"],
58 ["moose", "herd"],
59 ["mosquitoes", "scourge"],
60 ["nightingales", "watch"],
61 ["oysters", "bed"],
62 ["partridges", "covey"],
63 ["pelicans", "pod"],
64 ["raccoons", "gaze"],
65 ["ravens", "unkindness"],
66 ["rhinoceroses", "crash"],
67 ["sea urchins", "sea"],
68 ["starlings", "murmuration"],
69 ["toads", "knot"],
70 ["wombats", "wisdom"],
71 ["woodcocks", "fall"],
72 ["woodpeckers", "descent"],
73 ["wrens", "herd"],
74 ]
75
76 generic_terms = [
77 "group",
78 "bunch",
79 ]
80
81 list = []
82 for term_pair in term_list:
83 for generic in generic_terms:
84 wrong = f"a {generic} of {term_pair[0]}"
85 right = f"a {term_pair[1]} of {term_pair[0]}"
86 list += [[right, [wrong]]]
87
88 return preferred_forms_check(text, list, err, msg)