| 1 |
"""Inconsistent spelling. |
| 2 |
|
| 3 |
--- |
| 4 |
layout: post |
| 5 |
source: Intelligent Editing Ltd. |
| 6 |
source_url: http://bit.ly/1x3hYj7 |
| 7 |
title: Inconsistent spelling |
| 8 |
date: 2014-06-10 12:31:19 |
| 9 |
categories: writing |
| 10 |
--- |
| 11 |
|
| 12 |
Intelligent Editing Ltd. says: |
| 13 |
|
| 14 |
> Some words have more than one correct spelling. American, British, Australian |
| 15 |
and Canadian English all have their own preferences. Even within those, there |
| 16 |
can be multiple spellings. For example, in the UK 'realise' is often preferred. |
| 17 |
However, 'realize' has been used in British-English for centuries and is |
| 18 |
preferred in the Oxford English Dictionary. However, no matter which spelling |
| 19 |
is preferred, one thing is always wrong: you mustn't use two different |
| 20 |
spellings in the same document. |
| 21 |
""" |
| 22 |
from proselint.tools import consistency_check, memoize |
| 23 |
|
| 24 |
|
| 25 |
@memoize |
| 26 |
def check(text): |
| 27 |
"""Check the text.""" |
| 28 |
err = "consistency.spelling" |
| 29 |
msg = "Inconsistent spelling of '{}' (vs. '{}')." |
| 30 |
|
| 31 |
word_pairs = [ |
| 32 |
["advisor", "adviser"], |
| 33 |
# ["analyse", "analyze"], |
| 34 |
["centre", "center"], |
| 35 |
["colour", "color"], |
| 36 |
["emphasise", "emphasize"], |
| 37 |
["finalise", "finalize"], |
| 38 |
["focussed", "focused"], |
| 39 |
["labour", "labor"], |
| 40 |
["learnt", "learned"], |
| 41 |
["organise", "organize"], |
| 42 |
["organised", "organized"], |
| 43 |
["organising", "organizing"], |
| 44 |
["recognise", "recognize"], |
| 45 |
] |
| 46 |
|
| 47 |
return consistency_check(text, word_pairs, err, msg) |