[
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Jonas McCallum\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.rst",
    "content": "===========\nautocorrect\n===========\nPython 3 Spelling Corrector\n\nDeprecated Fork\n===============\nThis is a deprecated fork. If you wish to contribute to the project, please visit the active fork https://github.com/fifimajster/autocorrect maintained by the awesome legend coder Filip Sondej\n\nInstallation\n============\n.. code-block:: bash\n\n    pip install autocorrect\n\nExamples\n========\n.. code-block:: python\n\n    >>> from autocorrect import spell\n    >>> spell('HTe')\n    'The'\n"
  },
  {
    "path": "autocorrect/__init__.py",
    "content": "# Python 3 Spelling Corrector\n#\n# Copyright 2014 Jonas McCallum.\n# Updated for Python 3, based on Peter Norvig's\n# 2007 version: http://norvig.com/spell-correct.html\n#\n# Open source, MIT license\n# http://www.opensource.org/licenses/mit-license.php\n\"\"\"\nSpell function\n\nAuthor: Jonas McCallum\nhttps://github.com/foobarmus/autocorrect\n\n\"\"\"\nfrom autocorrect.nlp_parser import NLP_COUNTS\nfrom autocorrect.word import Word, common, exact, known, get_case\n\ndef spell(word):\n    \"\"\"most likely correction for everything up to a double typo\"\"\"\n    w = Word(word)\n    candidates = (common([word]) or exact([word]) or known([word]) or\n                  known(w.typos()) or common(w.double_typos()) or\n                  [word])\n    correction = max(candidates, key=NLP_COUNTS.get)\n    return get_case(word, correction)\n"
  },
  {
    "path": "autocorrect/nlp_parser.py",
    "content": "# Python 3 Spelling Corrector\n#\n# Copyright 2014 Jonas McCallum.\n# Updated for Python 3, based on Peter Norvig's\n# 2007 version: http://norvig.com/spell-correct.html\n#\n# Open source, MIT license\n# http://www.opensource.org/licenses/mit-license.php\n\"\"\"\nNLP parser\n\nAuthor: Jonas McCallum\nhttps://github.com/foobarmus/autocorrect\n\n\"\"\"\nfrom autocorrect.utils import words_from_archive, zero_default_dict\n\ndef parse(lang_sample):\n    \"\"\"tally word popularity using novel extracts, etc\"\"\"\n    words = words_from_archive(lang_sample, include_dups=True)\n    counts = zero_default_dict()\n    for word in words:\n        counts[word] += 1\n    return set(words), counts\n\nNLP_WORDS, NLP_COUNTS = parse('big.txt')\n"
  },
  {
    "path": "autocorrect/utils.py",
    "content": "# Python 3 Spelling Corrector\n#\n# Copyright 2014 Jonas McCallum.\n# Updated for Python 3, based on Peter Norvig's\n# 2007 version: http://norvig.com/spell-correct.html\n#\n# Open source, MIT license\n# http://www.opensource.org/licenses/mit-license.php\n\"\"\"\nFile reader, concat function and dict wrapper\n\nAuthor: Jonas McCallum\nhttps://github.com/foobarmus/autocorrect\n\n\"\"\"\nimport re, os, tarfile\nfrom contextlib import closing\nfrom itertools import chain\n\nPATH = os.path.abspath(os.path.dirname(__file__))\nBZ2 = 'words.bz2'\nRE = '[A-Za-z]+'\n\ndef words_from_archive(filename, include_dups=False, map_case=False):\n    \"\"\"extract words from a text file in the archive\"\"\"\n    bz2 = os.path.join(PATH, BZ2)\n    tar_path = '{}/{}'.format('words', filename)\n    with closing(tarfile.open(bz2, 'r:bz2')) as t:\n        with closing(t.extractfile(tar_path)) as f:\n            words = re.findall(RE, f.read().decode(encoding='utf-8'))\n    if include_dups:\n        return words\n    elif map_case:\n        return {w.lower():w for w in words}\n    else:\n        return set(words)\n\ndef concat(*args):\n    \"\"\"reversed('th'), 'e' => 'hte'\"\"\"\n    try:\n        return ''.join(args)\n    except TypeError:\n        return ''.join(chain.from_iterable(args))\n\nclass Zero(dict):\n    \"\"\"dict with a zero default\"\"\"\n\n    def __getitem__(self, key):\n        return self.get(key)\n\n    def get(self, key):\n        try:\n            return super(Zero, self).__getitem__(key)\n        except KeyError:\n            return 0\n\nzero_default_dict = Zero\n"
  },
  {
    "path": "autocorrect/word.py",
    "content": "# Python 3 Spelling Corrector\n#\n# Copyright 2014 Jonas McCallum.\n# Updated for Python 3, based on Peter Norvig's\n# 2007 version: http://norvig.com/spell-correct.html\n#\n# Open source, MIT license\n# http://www.opensource.org/licenses/mit-license.php\n\"\"\"\nWord based methods and functions\n\nAuthor: Jonas McCallum\nhttps://github.com/foobarmus/autocorrect\n\n\"\"\"\nfrom autocorrect.utils import concat\nfrom autocorrect.nlp_parser import NLP_WORDS\nfrom autocorrect.word_lists import LOWERCASE, MIXED_CASE\nfrom autocorrect.word_lists import LOWERED, CASE_MAPPED\n\nALPHABET = 'abcdefghijklmnopqrstuvwxyz'\nKNOWN_WORDS = LOWERCASE | LOWERED | NLP_WORDS\n\nclass Word(object):\n    \"\"\"container for word-based methods\"\"\"\n\n    def __init__(self, word):\n        \"\"\"\n        Generate slices to assist with typo\n        definitions.\n\n        'the' => (('', 'the'), ('t', 'he'),\n                  ('th', 'e'), ('the', ''))\n\n        \"\"\"\n        word_ = word.lower()\n        slice_range = range(len(word_) + 1)\n        self.slices = tuple((word_[:i], word_[i:])\n                            for i in slice_range)\n        self.word = word\n\n    def _deletes(self):\n        \"\"\"th\"\"\"\n        return {concat(a, b[1:])\n                for a, b in self.slices[:-1]}\n\n    def _transposes(self):\n        \"\"\"teh\"\"\"\n        return {concat(a, reversed(b[:2]), b[2:])\n                for a, b in self.slices[:-2]}\n\n    def _replaces(self):\n        \"\"\"tge\"\"\"\n        return {concat(a, c, b[1:])\n                for a, b in self.slices[:-1]\n                for c in ALPHABET}\n\n    def _inserts(self):\n        \"\"\"thwe\"\"\"\n        return {concat(a, c, b)\n                for a, b in self.slices\n                for c in ALPHABET}\n\n    def typos(self):\n        \"\"\"letter combinations one typo away from word\"\"\"\n        return (self._deletes() | self._transposes() |\n                self._replaces() | self._inserts())\n\n    def double_typos(self):\n        \"\"\"letter combinations two typos away from word\"\"\"\n        return {e2 for e1 in self.typos()\n                for e2 in Word(e1).typos()}\n\n\ndef common(words):\n    \"\"\"{'the', 'teh'} => {'the'}\"\"\"\n    return set(words) & NLP_WORDS\n\ndef exact(words):\n    \"\"\"{'Snog', 'snog', 'Snoddy'} => {'Snoddy'}\"\"\"\n    return set(words) & MIXED_CASE\n\ndef known(words):\n    \"\"\"{'Gazpacho', 'gazzpacho'} => {'gazpacho'}\"\"\"\n    return {w.lower() for w in words} & KNOWN_WORDS\n\ndef known_as_lower(words):\n    \"\"\"{'Natasha', 'Bob'} => {'bob'}\"\"\"\n    return {w.lower() for w in words} & LOWERCASE\n\ndef get_case(word, correction):\n    \"\"\"\n    Best guess of intended case.\n\n    manchester => manchester\n    chilton => Chilton\n    AAvTech => AAvTech\n    THe => The\n    imho => IMHO\n\n    \"\"\"\n    if word.istitle():\n        return correction.title()\n    if word.isupper():\n        return correction.upper()\n    if correction == word and not word.islower():\n        return word\n    if len(word) > 2 and word[:2].isupper():\n        return correction.title()\n    if not known_as_lower([correction]): #expensive\n        try:\n            return CASE_MAPPED[correction]\n        except KeyError:\n            pass\n    return correction\n"
  },
  {
    "path": "autocorrect/word_lists.py",
    "content": "# Python 3 Spelling Corrector\n#\n# Copyright 2014 Jonas McCallum.\n# Updated for Python 3, based on Peter Norvig's\n# 2007 version: http://norvig.com/spell-correct.html\n#\n# Open source, MIT license\n# http://www.opensource.org/licenses/mit-license.php\n\"\"\"\nWord lists for case sensitive/insensitive lookups\n\nAuthor: Jonas McCallum\nhttps://github.com/foobarmus/autocorrect\n\n\"\"\"\nfrom autocorrect.utils import words_from_archive\n\n# en_US_GB_CA is a superset of US, GB and CA\n# spellings (color, colour, etc). It contains\n# roughly half a million words. For this\n# example, imagine it's just seven words...\n#\n# we (lower)\n# flew (lower)\n# to (lower)\n# Abu (mixed)\n# Dhabi (mixed)\n# via (lower)\n# Colombo (mixed)\n\nLOWERCASE = words_from_archive('en_US_GB_CA_lower.txt')\n# {'we', 'flew', 'to', 'via'}\n\nCASE_MAPPED = words_from_archive('en_US_GB_CA_mixed.txt',\n                                 map_case=True)\n#  {abu': 'Abu',\n#  'dhabi': 'Dhabi',\n#  'colombo': 'Colombo'}\n#\n# Note that en_US_GB_CA_mixed.txt also contains\n# acronyms/mixed case variants of common words,\n# so in reality, CASE_MAPPED also contains: \n#\n# {'to': 'TO',\n#  'via': 'Via'}\n\nMIXED_CASE = set(CASE_MAPPED.values())\n# {'Abu', 'Dhabi', 'Colombo'}\n\nLOWERED = set(CASE_MAPPED.keys())\n# {'abu', 'dhabi', 'colombo'}\n"
  },
  {
    "path": "setup.py",
    "content": "from distutils.core import setup\n\nsetup(name='autocorrect',\n      version='0.3.0',\n      packages=['autocorrect'],\n      package_data={'autocorrect': ['words.bz2']},\n      description='Python 3 Spelling Corrector',\n      author='Jonas McCallum',\n      author_email='jonasmccallum@gmail.com',\n      url='https://github.com/phatpiglet/autocorrect/',\n      license='http://www.opensource.org/licenses/mit-license.php',\n      classifiers=('Intended Audience :: Developers',\n                   'License :: OSI Approved :: MIT License',\n                   'Natural Language :: English',\n                   'Programming Language :: Python',\n                   'Programming Language :: Python :: 2.7',\n                   'Programming Language :: Python :: 3',),\n      keywords='autocorrect spelling corrector')\n"
  },
  {
    "path": "unit_tests/test.py",
    "content": "import os, sys, time\nfrom copy import deepcopy\n\nPATH = os.path.abspath(os.path.dirname(__file__))\nSOURCE_DIR = os.path.split(PATH)[0]\nsys.path.append(SOURCE_DIR)\nfrom autocorrect import spell\nfrom autocorrect.word import known\nfrom autocorrect.nlp_parser import NLP_COUNTS\n\nMSG = 'spell({}) => {} ({}); should be {} ({})'\nRESULT = 'bad: {}/{}, % correct: {}, unknown: {}, secs: {}'\n\ndef spelltest(tests, verbose=False):\n    n, bad, unknown, start = 0, 0, 0, time.clock()\n    for target, incorrect_spellings in tests.items():\n        for incorrect_spelling in incorrect_spellings.split():\n            n += 1\n            w = spell(incorrect_spelling)\n            if w != target:\n                bad += 1\n                if not known([target]):\n                    unknown += 1\n                if verbose:\n                    print(MSG.format(incorrect_spelling, w, NLP_COUNTS[w],\n                                     target, NLP_COUNTS[target]))\n    return RESULT.format(bad, n, int(100. - 100. * bad / n), \n                         unknown, int(time.clock() - start))\n\ntests1 = {'access': 'acess',\n          'accessing': 'accesing',\n          'accommodation': 'accomodation acommodation acomodation',\n          'account': 'acount',\n          'address': 'adress adres',\n          'addressable': 'addresable',\n          'arranged': 'aranged arrainged',\n          'arrangeing': 'aranging',\n          'arrangement': 'arragment',\n          'articles': 'articals',\n          'aunt': 'annt anut arnt',\n          'auxiliary': 'auxillary',\n          'available': 'avaible',\n          'awful': 'awfall afful',\n          'basically': 'basicaly',\n          'beginning': 'begining',\n          'benefit': 'benifit',\n          'benefits': 'benifits',\n          'between': 'beetween',\n          'bicycle': 'bicycal bycicle bycycle',\n          'biscuits': 'biscits biscutes biscuts bisquits buiscits buiscuts',\n          'built': 'biult',\n          'cake': 'cak',\n          'career': 'carrer',\n          'cemetery': 'cemetary semetary',\n          'centrally': 'centraly',\n          'certain': 'cirtain',\n          'challenges': 'chalenges chalenges',\n          'chapter': 'chaper chaphter chaptur',\n          'choice': 'choise',\n          'choosing': 'chosing',\n          'clerical': 'clearical',\n          'committee': 'comittee',\n          'compare': 'compair',\n          'completely': 'completly',\n          'consider': 'concider',\n          'considerable': 'conciderable',\n          'contented': 'contenpted contende contended contentid',\n          'curtains': 'cartains certans courtens cuaritains curtans curtians curtions',\n          'decide': 'descide',\n          'decided': 'descided',\n          'definitely': 'definately difinately',\n          'definition': 'defenition',\n          'definitions': 'defenitions',\n          'description': 'discription',\n          'desiccate': 'desicate dessicate dessiccate',\n          'diagrammatically': 'diagrammaticaally',\n          'different': 'diffrent',\n          'driven': 'dirven',\n          'ecstasy': 'exstacy ecstacy',\n          'embarrass': 'embaras embarass',\n          'establishing': 'astablishing establising',\n          'experience': 'experance experiance',\n          'experiences': 'experances',\n          'extended': 'extented',\n          'extremely': 'extreamly',\n          'fails': 'failes',\n          'families': 'familes',\n          'february': 'febuary',\n          'further': 'futher',\n          'gallery': 'galery gallary gallerry gallrey',\n          'hierarchal': 'hierachial',\n          'hierarchy': 'hierchy',\n          'inconvenient': 'inconvienient inconvient inconvinient',\n          'independent': 'independant independant',\n          'initial': 'intial',\n          'initials': 'inetials inistals initails initals intials',\n          'juice': 'guic juce jucie juise juse',\n          'latest': 'lates latets latiest latist',\n          'laugh': 'lagh lauf laught lugh',\n          'level': 'leval',\n          'levels': 'levals',\n          'liaison': 'liaision liason',\n          'lieu': 'liew',\n          'literature': 'litriture',\n          'loans': 'lones',\n          'locally': 'localy',\n          'magnificent': 'magnificnet magificent magnifcent magnifecent magnifiscant magnifisent magnificant',\n          'management': 'managment',\n          'meant': 'ment',\n          'minuscule': 'miniscule',\n          'minutes': 'muinets',\n          'monitoring': 'monitering',\n          'necessary': 'neccesary necesary neccesary necassary necassery neccasary',\n          'occurrence': 'occurence occurence',\n          'often': 'ofen offen offten ofton',\n          'opposite': 'opisite oppasite oppesite oppisit oppisite opposit oppossite oppossitte',\n          'parallel': 'paralel paralell parrallel parralell parrallell',\n          'particular': 'particulaur',\n          'perhaps': 'perhapse',\n          'personnel': 'personnell',\n          'planned': 'planed',\n          'poem': 'poame',\n          'poems': 'poims pomes',\n          'poetry': 'poartry poertry poetre poety powetry',\n          'position': 'possition',\n          'possible': 'possable',\n          'pretend': 'pertend protend prtend pritend',\n          'problem': 'problam proble promblem proplen',\n          'pronunciation': 'pronounciation',\n          'purple': 'perple perpul poarple',\n          'questionnaire': 'questionaire',\n          'really': 'realy relley relly',\n          'receipt': 'receit receite reciet recipt',\n          'receive': 'recieve',\n          'refreshment': 'reafreshment refreshmant refresment refressmunt',\n          'remember': 'rember remeber rememmer rermember',\n          'remind': 'remine remined',\n          'scarcely': 'scarcly scarecly scarely scarsely',\n          'scissors': 'scisors sissors',\n          'separate': 'seperate',\n          'singular': 'singulaur',\n          'someone': 'somone',\n          'sources': 'sorces',\n          'southern': 'southen',\n          'special': 'speaical specail specal speical',\n          'splendid': 'spledid splended splened splended',\n          'standardizing': 'stanerdizing',\n          'stomach': 'stomac stomache stomec stumache',\n          'supersede': 'supercede superceed',\n          'there': 'ther',\n          'totally': 'totaly',\n          'transferred': 'transfred',\n          'transportability': 'transportibility',\n          'triangular': 'triangulaur',\n          'understand': 'undersand undistand',\n          'unexpected': 'unexpcted unexpeted unexspected',\n          'unfortunately': 'unfortunatly',\n          'unique': 'uneque',\n          'useful': 'usefull',\n          'valuable': 'valubale valuble',\n          'variable': 'varable',\n          'variant': 'vairiant',\n          'various': 'vairious',\n          'visited': 'fisited viseted vistid vistied',\n          'visitors': 'vistors',\n          'voluntary': 'volantry',\n          'voting': 'voteing',\n          'wanted': 'wantid wonted',\n          'whether': 'wether',\n          'wrote': 'rote wote'}\n\ntests2 = {'forbidden': 'forbiden',\n          'decisions': 'deciscions descisions',\n          'supposedly': 'supposidly',\n          'embellishing': 'embelishing',\n          'technique': 'tecnique',\n          'permanently': 'perminantly',\n          'confirmation': 'confermation',\n          'appointment': 'appoitment',\n          'progression': 'progresion',\n          'accompanying': 'acompaning',\n          'applicable': 'aplicable',\n          'regained': 'regined',\n          'guidelines': 'guidlines',\n          'surrounding': 'serounding',\n          'titles': 'tittles',\n          'unavailable': 'unavailble',\n          'advantageous': 'advantageos',\n          'brief': 'brif',\n          'appeal': 'apeal',\n          'consisting': 'consisiting',\n          'clerk': 'cleark clerck',\n          'component': 'componant',\n          'favourable': 'faverable',\n          'separation': 'seperation',\n          'search': 'serch',\n          'receive': 'recieve',\n          'employees': 'emploies',\n          'prior': 'piror',\n          'resulting': 'reulting',\n          'suggestion': 'sugestion',\n          'opinion': 'oppinion',\n          'cancellation': 'cancelation',\n          'criticism': 'citisum',\n          'useful': 'usful',\n          'humour': 'humor',\n          'anomalies': 'anomolies',\n          'would': 'whould',\n          'doubt': 'doupt',\n          'examination': 'eximination',\n          'therefore': 'therefoe',\n          'recommend': 'recomend',\n          'separated': 'seperated',\n          'successful': 'sucssuful succesful',\n          'apparent': 'apparant',\n          'occurred': 'occureed',\n          'particular': 'paerticulaur',\n          'pivoting': 'pivting',\n          'announcing': 'anouncing',\n          'challenge': 'chalange',\n          'arrangements': 'araingements',\n          'proportions': 'proprtions',\n          'organized': 'oranised',\n          'accept': 'acept',\n          'dependence': 'dependance',\n          'unequalled': 'unequaled',\n          'numbers': 'numbuers',\n          'sense': 'sence',\n          'conversely': 'conversly',\n          'provide': 'provid',\n          'arrangement': 'arrangment',\n          'responsibilities': 'responsiblities',\n          'fourth': 'forth',\n          'ordinary': 'ordenary',\n          'description': 'desription descvription desacription',\n          'inconceivable': 'inconcievable',\n          'data': 'dsata',\n          'register': 'rgister',\n          'supervision': 'supervison',\n          'encompassing': 'encompasing',\n          'negligible': 'negligable',\n          'allow': 'alow',\n          'operations': 'operatins',\n          'executed': 'executted',\n          'interpretation': 'interpritation',\n          'hierarchy': 'heiarky',\n          'indeed': 'indead',\n          'years': 'yesars',\n          'through': 'throut',\n          'committee': 'committe',\n          'inquiries': 'equiries',\n          'before': 'befor',\n          'continued': 'contuned',\n          'permanent': 'perminant',\n          'choose': 'chose',\n          'virtually': 'vertually',\n          'correspondence': 'correspondance',\n          'eventually': 'eventully',\n          'lonely': 'lonley',\n          'profession': 'preffeson',\n          'they': 'thay',\n          'now': 'noe',\n          'desperately': 'despratly',\n          'university': 'unversity',\n          'adjournment': 'adjurnment',\n          'possibilities': 'possablities',\n          'stopped': 'stoped',\n          'mean': 'meen',\n          'weighted': 'wagted',\n          'adequately': 'adequattly',\n          'shown': 'hown',\n          'matrix': 'matriiix',\n          'profit': 'proffit',\n          'encourage': 'encorage',\n          'collate': 'colate',\n          'disaggregate': 'disaggreagte disaggreaget',\n          'receiving': 'recieving reciving',\n          'proviso': 'provisoe',\n          'umbrella': 'umberalla',\n          'approached': 'aproached',\n          'pleasant': 'plesent',\n          'difficulty': 'dificulty',\n          'appointments': 'apointments',\n          'base': 'basse',\n          'conditioning': 'conditining',\n          'earliest': 'earlyest',\n          'beginning': 'begining',\n          'universally': 'universaly',\n          'unresolved': 'unresloved',\n          'length': 'lengh',\n          'exponentially': 'exponentualy',\n          'utilized': 'utalised',\n          'set': 'et',\n          'surveys': 'servays',\n          'families': 'familys',\n          'system': 'sysem',\n          'approximately': 'aproximatly',\n          'their': 'ther',\n          'scheme': 'scheem',\n          'speaking': 'speeking',\n          'repetitive': 'repetative',\n          'inefficient': 'ineffiect',\n          'geneva': 'geniva',\n          'exactly': 'exsactly',\n          'immediate': 'imediate',\n          'appreciation': 'apreciation',\n          'luckily': 'luckeley',\n          'eliminated': 'elimiated',\n          'believe': 'belive',\n          'appreciated': 'apreciated',\n          'readjusted': 'reajusted',\n          'were': 'wer where',\n          'feeling': 'fealing',\n          'and': 'anf',\n          'false': 'faulse',\n          'seen': 'seeen',\n          'interrogating': 'interogationg',\n          'academically': 'academicly',\n          'relatively': 'relativly relitivly',\n          'traditionally': 'traditionaly',\n          'studying': 'studing',\n          'majority': 'majorty',\n          'build': 'biuld',\n          'aggravating': 'agravating',\n          'transactions': 'trasactions',\n          'arguing': 'aurguing',\n          'sheets': 'sheertes',\n          'successive': 'sucsesive sucessive',\n          'segment': 'segemnt',\n          'especially': 'especaily',\n          'later': 'latter',\n          'senior': 'sienior',\n          'dragged': 'draged',\n          'atmosphere': 'atmospher',\n          'drastically': 'drasticaly',\n          'particularly': 'particulary',\n          'visitor': 'vistor',\n          'session': 'sesion',\n          'continually': 'contually',\n          'availability': 'avaiblity',\n          'busy': 'buisy',\n          'parameters': 'perametres',\n          'surroundings': 'suroundings seroundings',\n          'employed': 'emploied',\n          'adequate': 'adiquate',\n          'handle': 'handel',\n          'means': 'meens',\n          'familiar': 'familer',\n          'between': 'beeteen',\n          'overall': 'overal',\n          'timing': 'timeing',\n          'committees': 'comittees commitees',\n          'queries': 'quies',\n          'econometric': 'economtric',\n          'erroneous': 'errounous',\n          'decides': 'descides',\n          'reference': 'refereence refference',\n          'intelligence': 'inteligence',\n          'edition': 'ediion ediition',\n          'are': 'arte',\n          'apologies': 'appologies',\n          'thermawear': 'thermawere thermawhere',\n          'techniques': 'tecniques',\n          'voluntary': 'volantary',\n          'subsequent': 'subsequant subsiquent',\n          'currently': 'curruntly',\n          'forecast': 'forcast',\n          'weapons': 'wepons',\n          'routine': 'rouint',\n          'neither': 'niether',\n          'approach': 'aproach',\n          'available': 'availble',\n          'recently': 'reciently',\n          'ability': 'ablity',\n          'nature': 'natior',\n          'commercial': 'comersial',\n          'agencies': 'agences',\n          'however': 'howeverr',\n          'suggested': 'sugested',\n          'career': 'carear',\n          'many': 'mony',\n          'annual': 'anual',\n          'according': 'acording',\n          'receives': 'recives recieves',\n          'interesting': 'intresting',\n          'expense': 'expence',\n          'relevant': 'relavent relevaant',\n          'table': 'tasble',\n          'throughout': 'throuout',\n          'conference': 'conferance',\n          'sensible': 'sensable',\n          'described': 'discribed describd',\n          'union': 'unioun',\n          'interest': 'intrest',\n          'flexible': 'flexable',\n          'refered': 'reffered',\n          'controlled': 'controled',\n          'sufficient': 'suficient',\n          'dissension': 'desention',\n          'adaptable': 'adabtable',\n          'representative': 'representitive',\n          'irrelevant': 'irrelavent',\n          'unnecessarily': 'unessasarily',\n          'applied': 'upplied',\n          'apologised': 'appologised',\n          'these': 'thees thess',\n          'choices': 'choises',\n          'will': 'wil',\n          'procedure': 'proceduer',\n          'shortened': 'shortend',\n          'manually': 'manualy',\n          'disappointing': 'dissapoiting',\n          'excessively': 'exessively',\n          'comments': 'coments',\n          'containing': 'containg',\n          'develop': 'develope',\n          'credit': 'creadit',\n          'government': 'goverment',\n          'acquaintances': 'aquantences',\n          'orientated': 'orentated',\n          'widely': 'widly',\n          'advise': 'advice',\n          'difficult': 'dificult',\n          'investigated': 'investegated',\n          'bonus': 'bonas',\n          'conceived': 'concieved',\n          'nationally': 'nationaly',\n          'compared': 'comppared compased',\n          'moving': 'moveing',\n          'necessity': 'nessesity',\n          'opportunity': 'oppertunity oppotunity opperttunity',\n          'thoughts': 'thorts',\n          'equalled': 'equaled',\n          'variety': 'variatry',\n          'analysis': 'analiss analsis analisis',\n          'patterns': 'pattarns',\n          'qualities': 'quaties',\n          'easily': 'easyly',\n          'organization': 'oranisation oragnisation',\n          'the': 'thw hte thi',\n          'corporate': 'corparate',\n          'composed': 'compossed',\n          'enormously': 'enomosly',\n          'financially': 'financialy',\n          'functionally': 'functionaly',\n          'discipline': 'disiplin',\n          'announcement': 'anouncement',\n          'progresses': 'progressess',\n          'except': 'excxept',\n          'recommending': 'recomending',\n          'mathematically': 'mathematicaly',\n          'source': 'sorce',\n          'combine': 'comibine',\n          'input': 'inut',\n          'careers': 'currers carrers',\n          'resolved': 'resoved',\n          'demands': 'diemands',\n          'unequivocally': 'unequivocaly',\n          'suffering': 'suufering',\n          'immediately': 'imidatly imediatly',\n          'accepted': 'acepted',\n          'projects': 'projeccts',\n          'necessary': 'necasery nessasary nessisary neccassary',\n          'journalism': 'journaism',\n          'unnecessary': 'unessessay',\n          'night': 'nite',\n          'output': 'oputput',\n          'security': 'seurity',\n          'essential': 'esential',\n          'beneficial': 'benificial benficial',\n          'explaining': 'explaning',\n          'supplementary': 'suplementary',\n          'questionnaire': 'questionare',\n          'employment': 'empolyment',\n          'proceeding': 'proceding',\n          'decision': 'descisions descision',\n          'per': 'pere',\n          'discretion': 'discresion',\n          'reaching': 'reching',\n          'analysed': 'analised',\n          'expansion': 'expanion',\n          'although': 'athough',\n          'subtract': 'subtrcat',\n          'analysing': 'aalysing',\n          'comparison': 'comparrison',\n          'months': 'monthes',\n          'hierarchal': 'hierachial',\n          'misleading': 'missleading',\n          'commit': 'comit',\n          'auguments': 'aurgument',\n          'within': 'withing',\n          'obtaining': 'optaning',\n          'accounts': 'acounts',\n          'primarily': 'pimarily',\n          'operator': 'opertor',\n          'accumulated': 'acumulated',\n          'extremely': 'extreemly',\n          'there': 'thear',\n          'summarys': 'sumarys',\n          'analyse': 'analiss',\n          'understandable': 'understadable',\n          'safeguard': 'safegaurd',\n          'consist': 'consisit',\n          'declarations': 'declaratrions',\n          'minutes': 'muinutes muiuets',\n          'associated': 'assosiated',\n          'accessibility': 'accessability',\n          'examine': 'examin',\n          'surveying': 'servaying',\n          'politics': 'polatics',\n          'annoying': 'anoying',\n          'again': 'agiin',\n          'assessing': 'accesing',\n          'ideally': 'idealy',\n          'scrutinized': 'scrutiniesed',\n          'simular': 'similar',\n          'personnel': 'personel',\n          'whereas': 'wheras',\n          'when': 'whn',\n          'geographically': 'goegraphicaly',\n          'gaining': 'ganing',\n          'requested': 'rquested',\n          'separate': 'seporate',\n          'students': 'studens',\n          'prepared': 'prepaired',\n          'generated': 'generataed',\n          'graphically': 'graphicaly',\n          'suited': 'suted',\n          'variable': 'varible vaiable',\n          'building': 'biulding',\n          'required': 'reequired',\n          'necessitates': 'nessisitates',\n          'together': 'togehter',\n          'profits': 'proffits'}\n\nif __name__ == '__main__':\n    print(spelltest(tests1))\n"
  }
]