mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 01:05:01 -04:00
adds inflections for irregular plural crop names
This commit is contained in:
committed by
Brenda Wallace
parent
012cd75f5f
commit
e6007dc094
@@ -16,15 +16,202 @@
|
||||
|
||||
ActiveSupport::Inflector.inflections do |inflect|
|
||||
inflect.plural 'square foot', 'square feet'
|
||||
inflect.plural 'broccoli', 'broccoli'
|
||||
inflect.plural 'kale', 'kale'
|
||||
inflect.plural 'squash', 'squash'
|
||||
inflect.plural 'bok choy', 'bok choy'
|
||||
|
||||
# crops
|
||||
inflect.plural 'achiote', 'achiote'
|
||||
inflect.plural 'agave', 'agave'
|
||||
inflect.plural 'alfalfa', 'alfalfa'
|
||||
inflect.plural 'allspice', 'allspice'
|
||||
inflect.plural 'spinach', 'spinach'
|
||||
inflect.plural 'aloe vera', 'arugula'
|
||||
inflect.plural 'amaranth', 'amaranth'
|
||||
inflect.plural 'Amelanchier', 'Amelanchier'
|
||||
inflect.plural 'anise', 'anise'
|
||||
inflect.plural 'anise hyssop', 'anise hyssop'
|
||||
inflect.plural 'arrowroot', 'arrowroot'
|
||||
inflect.plural 'arugula', 'arugula'
|
||||
inflect.plural 'asparagus', 'asparagus'
|
||||
inflect.plural 'avocado', 'avocadoes'
|
||||
inflect.plural 'balm', 'balm'
|
||||
inflect.plural 'bamboo', 'bamboo'
|
||||
inflect.plural 'barley', 'barley'
|
||||
inflect.plural 'basil', 'basil'
|
||||
inflect.plural 'beebalm', 'beebalm'
|
||||
inflect.plural 'black mustard', 'black mustard'
|
||||
inflect.plural 'bok choy', 'bok choy'
|
||||
inflect.plural 'borage', 'borage'
|
||||
inflect.plural 'Brassica', 'Brassica'
|
||||
inflect.plural 'Brassica oleracea', 'Brassica oleracea'
|
||||
inflect.plural 'Brassica oleracea Acephela group', 'Brassica oleracea Acephela group'
|
||||
inflect.plural 'Brassica rapa', 'Brassica rapa'
|
||||
inflect.plural 'Brazilian starfish', 'Brazilian starfish'
|
||||
inflect.plural 'breadfruit', 'breadfruit'
|
||||
inflect.plural 'broccoflower', 'broccoflower'
|
||||
inflect.plural 'broccoli', 'broccoli'
|
||||
inflect.plural 'broccolini', 'broccolini'
|
||||
inflect.plural 'Brussels sprouts', 'Brussels sprouts'
|
||||
inflect.plural 'buckwheat', 'buckwheat'
|
||||
inflect.plural 'burdock', 'burdock'
|
||||
inflect.plural 'cabbage', 'cabbage'
|
||||
inflect.plural 'calamint', 'calamint'
|
||||
inflect.plural 'cantueso', 'cantueso'
|
||||
inflect.plural 'capsicum', 'capsica'
|
||||
inflect.plural 'capsicum annuum', 'capsicum annuum'
|
||||
inflect.plural 'Capsicum baccatum', 'Capsicum baccatum'
|
||||
inflect.plural 'Capsicum chinense', 'Capsicum chinense'
|
||||
inflect.plural 'cardinal vine', 'cardinal vine'
|
||||
inflect.plural 'catnip', 'catnip'
|
||||
inflect.plural 'cauliflower', 'cauliflower'
|
||||
inflect.plural 'cavalo nero', 'cavalo nero'
|
||||
inflect.plural 'celeriac', 'celeriac'
|
||||
inflect.plural 'celery', 'celery'
|
||||
inflect.plural 'celtuce', 'celtuce'
|
||||
inflect.plural 'chard', 'chard'
|
||||
inflect.plural 'chaya', 'chaya'
|
||||
inflect.plural 'chervil', 'chervil'
|
||||
inflect.plural 'chia', 'chia'
|
||||
inflect.plural 'chickweed', 'chickweed'
|
||||
inflect.plural 'chicory', 'chicory'
|
||||
inflect.plural 'chilli', 'chillies'
|
||||
inflect.plural 'chilli pepper', 'chilli peppers'
|
||||
inflect.plural 'choy sum', 'choy sum'
|
||||
inflect.plural 'cicely', 'cicely'
|
||||
inflect.plural 'citron', 'citrones'
|
||||
inflect.plural 'coffee', 'coffee'
|
||||
inflect.plural 'comfrey', 'comfrey'
|
||||
inflect.plural 'coriander', 'coriander'
|
||||
inflect.plural 'corn', 'corn'
|
||||
inflect.plural 'corn salad', 'corn salad'
|
||||
inflect.plural 'cress', 'cress'
|
||||
inflect.plural 'Cucurbita maxima', 'Cucurbita maxima'
|
||||
inflect.plural 'cumin', 'cumin'
|
||||
inflect.plural 'curry leaf', 'curry leaves'
|
||||
inflect.plural 'dill', 'dill'
|
||||
inflect.plural 'epazote', 'epazote'
|
||||
inflect.plural 'fennel', 'fennel'
|
||||
inflect.plural 'fenugreek', 'fenugreek'
|
||||
inflect.plural 'flax', 'flax'
|
||||
inflect.plural 'galangal', 'galangal'
|
||||
inflect.plural 'garlic', 'garlic'
|
||||
inflect.plural 'ginger', 'ginger'
|
||||
inflect.plural 'goji', 'goji'
|
||||
inflect.plural 'Good King Henry', 'Good King Henry'
|
||||
inflect.plural 'grains of paradise', 'grains of paradise'
|
||||
inflect.plural 'grapefruit', 'grapefruit'
|
||||
inflect.plural 'greater galangal', 'greater galangal'
|
||||
inflect.plural 'guava', 'guava'
|
||||
inflect.plural 'hemp', 'hemp'
|
||||
inflect.plural 'hibiscus', 'hibiscuses'
|
||||
inflect.plural 'hyssop', 'hyssop'
|
||||
inflect.plural 'jabuticaba', 'jabuticaba'
|
||||
inflect.plural 'jasmine', 'jasmine'
|
||||
inflect.plural 'kabocha', 'kabocha'
|
||||
inflect.plural 'kai lan', 'kai lan'
|
||||
inflect.plural 'kale', 'kale'
|
||||
inflect.plural 'kamo kamo', 'kamo kamo'
|
||||
inflect.plural 'karaka', 'karaka'
|
||||
inflect.plural 'kava', 'kava'
|
||||
inflect.plural 'kawakawa', 'kawakawa'
|
||||
inflect.plural 'kiwifruit', 'kiwifruit'
|
||||
inflect.plural 'kohlrabi', 'kohlrabies'
|
||||
inflect.plural 'komatsuna', 'komatsuna'
|
||||
inflect.plural "lady's bedstraw", "lady's bedstraw"
|
||||
inflect.plural 'lavender', 'lavender'
|
||||
inflect.plural 'lemon myrtle', 'lemon myrtle'
|
||||
inflect.plural 'lemonade', 'lemonade'
|
||||
inflect.plural 'lemongrass', 'lemongrass'
|
||||
inflect.plural 'lesser calamint', 'lesser calamint'
|
||||
inflect.plural 'lesser galangal', 'lesser galangal'
|
||||
inflect.plural 'lettuce', 'lettuce'
|
||||
inflect.plural 'licorice', 'licorice'
|
||||
inflect.plural 'lillipilli', 'lillipillies'
|
||||
inflect.plural 'lovage', 'lovage'
|
||||
inflect.plural 'luffa', 'luffa'
|
||||
inflect.plural 'macadamia', 'macadamia'
|
||||
inflect.plural 'mango', 'mangoes'
|
||||
inflect.plural 'maracuja', 'maracuja'
|
||||
inflect.plural 'marjoram', 'marjoram'
|
||||
inflect.plural 'mashua', 'mashua'
|
||||
inflect.plural 'milkweed', 'milkweed'
|
||||
inflect.plural 'mint', 'mint'
|
||||
inflect.plural 'miro', 'miro'
|
||||
inflect.plural 'mitsuba', 'mitsuba'
|
||||
inflect.plural 'mizuna', 'mizuna'
|
||||
inflect.plural 'moringa', 'moringa'
|
||||
inflect.plural 'mustard', 'mustard'
|
||||
inflect.plural 'oak', 'oak'
|
||||
inflect.plural 'okra', 'okra'
|
||||
inflect.plural 'olive herb', 'olive herb'
|
||||
inflect.plural 'olluco', 'olluco'
|
||||
inflect.plural 'oregano', 'oregano'
|
||||
inflect.plural 'pandan', 'pandan'
|
||||
inflect.plural 'parsley', 'parsley'
|
||||
inflect.plural 'passion fruit', 'passion fruit'
|
||||
inflect.plural 'pearl millet', 'pearl millet'
|
||||
inflect.plural 'pennyroyal', 'pennyroyal'
|
||||
inflect.plural 'peppermint', 'peppermint'
|
||||
inflect.plural 'perilla', 'perilla'
|
||||
inflect.plural 'persimmon', 'persimmon'
|
||||
inflect.plural 'potato', 'potatoes'
|
||||
inflect.plural 'potato Gladstone', 'potato Gladstone'
|
||||
inflect.plural 'potato matariki', 'potato matariki'
|
||||
inflect.plural 'potato Taranaki', 'potato Taranaki'
|
||||
inflect.plural 'Prince of Wales', 'Prince of Wales'
|
||||
inflect.plural 'purslane', 'purslane'
|
||||
inflect.plural 'quinoa', 'quinoa'
|
||||
inflect.plural 'rainbow chard', 'rainbow chard'
|
||||
inflect.plural 'rapeseed', 'rapeseed'
|
||||
inflect.plural 'rapini', 'rapini'
|
||||
inflect.plural 'rhubarb', 'rhubarb'
|
||||
inflect.plural 'rosemary', 'rosemary'
|
||||
inflect.plural 'rutabaga', 'rutabaga'
|
||||
inflect.plural 'rye', 'rye'
|
||||
inflect.plural 'safflower', 'safflower'
|
||||
inflect.plural 'saffron', 'saffron'
|
||||
inflect.plural 'sage', 'sage'
|
||||
inflect.plural 'salad burnet', 'salad burnet'
|
||||
inflect.plural 'salsify', 'salsify'
|
||||
inflect.plural 'salvia', 'salvia'
|
||||
inflect.plural 'sassafras', 'sassafras'
|
||||
inflect.plural 'sesame', 'sesame'
|
||||
inflect.plural 'shiitake', 'shiitake'
|
||||
inflect.plural 'smallage', 'smallage'
|
||||
inflect.plural 'sorghum', 'sorghum'
|
||||
inflect.plural 'soybean', 'soybean'
|
||||
inflect.plural 'spearmint', 'spearmint'
|
||||
inflect.plural 'spinach', 'spinach'
|
||||
inflect.plural 'spinach Santana', 'spinach Santana'
|
||||
inflect.plural 'spring greens', 'spring greens'
|
||||
inflect.plural 'squash', 'squash'
|
||||
inflect.plural 'star anise', 'star anise'
|
||||
inflect.plural 'starfruit', 'starfruit'
|
||||
inflect.plural 'stevia', 'stevia'
|
||||
inflect.plural 'summer savory', 'summer savory'
|
||||
inflect.plural 'Swiss chard', 'Swiss chard'
|
||||
inflect.plural 'tamarind', 'tamarind'
|
||||
inflect.plural 'tampala', 'tampala'
|
||||
inflect.plural 'tansy', 'tansy'
|
||||
inflect.plural 'taro', 'taro'
|
||||
inflect.plural 'tarragon', 'tarragon'
|
||||
inflect.plural 'tatsoi', 'tatsoi'
|
||||
inflect.plural 'tawa', 'tawa'
|
||||
inflect.plural 'tea', 'tea'
|
||||
inflect.plural 'thyme', 'thyme'
|
||||
inflect.plural 'tromboncino', 'tromboncini'
|
||||
inflect.plural 'turmeric', 'turmeric'
|
||||
inflect.plural 'valerian', 'valerian'
|
||||
inflect.plural 'vanilla', 'vanilla'
|
||||
inflect.plural 'violet cauliflower', 'violet cauliflower'
|
||||
inflect.plural 'wasabi', 'wasabi'
|
||||
inflect.plural 'water caltrop', 'water caltrop'
|
||||
inflect.plural 'watercress', 'watercress'
|
||||
inflect.plural 'wattle', 'wattle'
|
||||
inflect.plural 'wheat', 'wheat'
|
||||
inflect.plural 'wild baccatum', 'wild baccatum'
|
||||
inflect.plural 'wild bergamot', 'wild bergamot'
|
||||
inflect.plural 'winter savory', 'winter savory'
|
||||
inflect.plural 'wormwood', 'wormwood'
|
||||
inflect.plural 'yarrow', 'yarrow'
|
||||
inflect.plural 'yerba buena', 'yerba buena'
|
||||
inflect.plural "za'atar", "za'atar"
|
||||
inflect.plural 'zucchini', 'zucchini'
|
||||
end
|
||||
|
||||
@@ -17,5 +17,37 @@ feature "irregular crop inflections" do
|
||||
expect("garlic".pluralize).to eq "garlic"
|
||||
expect("licorice".pluralize).to eq "licorice"
|
||||
expect("lillipilli".pluralize).to eq "lillipillies"
|
||||
expect("barley".pluralize).to eq "barley"
|
||||
expect("Brassica oleracea Acephela group".pluralize).to eq "Brassica oleracea Acephela group"
|
||||
expect("common flax".pluralize).to eq "common flax"
|
||||
expect("cumin".pluralize).to eq "cumin"
|
||||
expect("Good King Henry".pluralize).to eq "Good King Henry"
|
||||
expect("oregano".pluralize).to eq "oregano"
|
||||
expect("star anise".pluralize).to eq "star anise"
|
||||
end
|
||||
|
||||
scenario "crops which are particularly irregular" do
|
||||
expect("curry leaf".pluralize).to eq "curry leaves"
|
||||
expect("capsicum".pluralize).to eq "capsica"
|
||||
end
|
||||
|
||||
scenario "crops which require -es" do
|
||||
expect("mango".pluralize).to eq "mangoes"
|
||||
expect("potato".pluralize).to eq "potatoes"
|
||||
expect("avocado".pluralize).to eq "avocadoes"
|
||||
end
|
||||
|
||||
scenario "crops where the first crop would normally be pluralized" do
|
||||
expect("Potato Onion".pluralize).to eq "Potato Onions"
|
||||
expect("lemon basil".pluralize).to eq "lemon basil"
|
||||
expect("pear tomato".pluralize).to eq "pear tomatoes"
|
||||
expect("chilli pepper".pluralize).to eq "chilli peppers"
|
||||
end
|
||||
|
||||
scenario "crops where the proper name succeeds the crop that would normally be pluralized" do
|
||||
expect("potato Taranaki".pluralize).to eq "potato Taranaki"
|
||||
expect("potato Gladstone".pluralize).to eq "potato Gladstone"
|
||||
expect("potato matariki".pluralize).to eq "potato matariki"
|
||||
expect("spinach Santana".pluralize).to eq "spinach Santana"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user