# -*- coding: utf-8 -*-
"""Mondegreens.

---
layout:     post
source:     Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title:      mondegreens
date:       2014-06-10 12:31:19
categories: writing
---

Points out preferred form.

"""
from tools import memoize, preferred_forms_check


@memoize
def check(text):
    """Suggest the preferred forms."""
    err = "garner.mondegreens"
    msg = "'{}' is the preferred form."

    list = [
        ["a girl with colitis goes by",  "a girl with kaleidascope eyes"],
        ["a partridge in a pear tree",   "a part-red gingerbread tree"],
        ["attorney and not a republic",  "attorney and notary public"],
        ["beck and call",                "beckon call"],
        ["for all intents and purposes", "for all intensive purposes"],
        ["laid him on the green",        "Lady Mondegreen"],
        ["Olive, the other reindeer",    "all of the other reindeer"],
        ["to the manner born",           "to the manor born"],
    ]

    return preferred_forms_check(text, list, err, msg)

# -*- coding: utf-8 -*-
"""Mondegreens.

---
layout:     post
source:     Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title:      mondegreens
date:       2014-06-10 12:31:19
categories: writing
---

Points out preferred form.

"""
from tools import memoize, preferred_forms_check


@memoize
def check(text):
    """Suggest the preferred forms."""
    err = "garner.mondegreens"
    msg = "'{}' is the preferred form."

    list = [
        ["a girl with kaleidascope eyes", "a girl with colitis goes by"],
        ["a partridge in a pear tree",    "a part-red gingerbread tree"],
        ["attorney and not a republic",   "attorney and notary public"],
        ["beck and call",                 "beckon call"],
        ["for all intents and purposes",  "for all intensive purposes"],
        ["laid him on the green",         "Lady Mondegreen"],
        ["Olive, the other reindeer",     "all of the other reindeer"],
        ["to the manner born",            "to the manor born"],
    ]

    return preferred_forms_check(text, list, err, msg)

Fix bug in mondegreen rule
Fix bug in mondegreen rule

(The correct versions should all be in the left column.)
