71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# CDDL HEADER START
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# The contents of this file are subject to the terms of the
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# Common Development and Distribution License (the "License").
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# You may not use this file except in compliance with the License.
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# or http://www.opensolaris.org/os/licensing.
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# See the License for the specific language governing permissions
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# and limitations under the License.
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# When distributing Covered Code, include this CDDL HEADER in each
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# If applicable, add the following below this CDDL HEADER, with the
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# fields enclosed by brackets "[]" replaced with your own identifying
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# information: Portions Copyright [yyyy] [name of copyright owner]
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# CDDL HEADER END
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello# Copyright 2016 Joyent, Inc.
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello#
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Melloimport re, sys
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter MellospellMsg = '%s: Line %d contains "%s", a common misspelling of "%s"\n'
71af3be340c57171837478555e2eb0d496318cfcCody Peter MelloaltMsg = '%s: Lined %d contains "%s"; please use "%s" instead for consistency with other documentation\n'
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mellomisspellings = {
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'absense': 'absence',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'accessable': 'accessible',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'accomodate': 'accommodate',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'accomodation': 'accommodation',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'accross': 'across',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'acheive': 'achieve',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'addional': 'additional',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'addres': 'address',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'admininistrative': 'administrative',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adminstered': 'administered',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adminstrate': 'administrate',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adminstration': 'administration',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adminstrative': 'administrative',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adminstrator': 'administrator',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'admissability': 'admissibility',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adress': 'address',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adressable': 'addressable',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adressed': 'addressed',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'adressing': 'addressing, dressing',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'aginst': 'against',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'agression': 'aggression',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'agressive': 'aggressive',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'alot': 'a lot, allot',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'and and': 'and',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'apparantly': 'apparently',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'appearence': 'appearance',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'arguement': 'argument',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'assasination': 'assassination',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'auxilliary': 'auxiliary',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'basicly': 'basically',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'begining': 'beginning',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'belive': 'believe',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'beteen': 'between',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'betwen': 'between',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'beween': 'between',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'bewteen': 'between',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'bizzare': 'bizarre',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'buisness': 'business',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'calender': 'calendar',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'cemetary': 'cemetery',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'chauffer': 'chauffeur',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'collegue': 'colleague',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'comming': 'coming',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'commited': 'committed',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'commitee': 'committee',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'commiting': 'committing',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'comparision': 'comparison',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'comparisions': 'comparisons',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'compatability': 'compatibility',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'compatable': 'compatible',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'compatablity': 'compatibility',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'compatiable': 'compatible',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'compatiblity': 'compatibility',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'completly': 'completely',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'concious': 'conscious',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'condidtion': 'condition',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'conected': 'connected',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'conjuction': 'conjunction',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'continous': 'continuous',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'curiousity': 'curiosity',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'deamon': 'daemon',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'definately': 'definitely',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'desireable': 'desirable',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'diffrent': 'different',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'dilemna': 'dilemma',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'dissapear': 'disappear',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'dissapoint': 'disappoint',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'ecstacy': 'ecstasy',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'embarass': 'embarrass',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'enviroment': 'environment',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'exept': 'except',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'existance': 'existence',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'familar': 'familiar',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'finaly': 'finally',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'folowing': 'following',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'foriegn': 'foreign',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'forseeable': 'foreseeable',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'fourty': 'forty',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'foward': 'forward',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'freind': 'friend',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'futher': 'further',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'gaurd': 'guard',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'glamourous': 'glamorous',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'goverment': 'government',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'happend': 'happened',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'harrassment': 'harassment',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'hierachical': 'hierarchical',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'hierachies': 'hierarchies',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'hierachy': 'hierarchy',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'hierarcical': 'hierarchical',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'hierarcy': 'hierarchy',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'honourary': 'honorary',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'humourous': 'humorous',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'idiosyncracy': 'idiosyncrasy',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'immediatly': 'immediately',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'inaccessable': 'inaccessible',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'inbetween': 'between',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'incidently': 'incidentally',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'independant': 'independent',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'infomation': 'information',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'interupt': 'interrupt',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'intial': 'initial',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'intially': 'initially',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'irresistable': 'irresistible',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'jist': 'gist',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'knowlege': 'knowledge',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'lenght': 'length',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'liase': 'liaise',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'liason': 'liaison',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'libary': 'library',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'maching': 'machine, marching, matching',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'millenia': 'millennia',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'millenium': 'millennium',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'neccessary': 'necessary',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'negotation': 'negotiation',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'nontheless': 'nonetheless',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'noticable': 'noticeable',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occassion': 'occasion',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occassional': 'occasional',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occassionally': 'occasionally',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occurance': 'occurrence',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occured': 'occurred',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occurence': 'occurrence',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'occuring': 'occurring',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'ommision': 'omission',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'orginal': 'original',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'orginally': 'originally',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'pavillion': 'pavilion',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'peice': 'piece',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'persistant': 'persistent',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'politican': 'politician',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'posession': 'possession',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'possiblity': 'possibility',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'preceed': 'precede',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'preceeded': 'preceded',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'preceeding': 'preceding',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'preceeds': 'precedes',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'prefered': 'preferred',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'prefering': 'preferring',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'presense': 'presence',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'proces': 'process',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'propoganda': 'propaganda',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'psuedo': 'pseudo',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'publically': 'publicly',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'realy': 'really',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'reciept': 'receipt',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recieve': 'receive',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recieved': 'received',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'reciever': 'receiver',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recievers': 'receivers',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recieves': 'receives',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recieving': 'receiving',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recomend': 'recommend',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recomended': 'recommended',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recomending': 'recommending',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recomends': 'recommends',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recurse': 'recur',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recurses': 'recurs',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'recursing': 'recurring',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'refered': 'referred',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'refering': 'referring',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'religous': 'religious',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'rember': 'remember',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'remeber': 'remember',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'repetion': 'repetition',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'reponsible': 'responsible',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'resistence': 'resistance',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'retreive': 'retrieve',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'seige': 'siege',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'sence': 'since',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'seperate': 'separate',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'seperated': 'separated',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'seperately': 'separately',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'seperates': 'separates',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'similiar': 'similar',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'somwhere': 'somewhere',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'sould': 'could, should, sold, soul',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'sturcture': 'structure',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'succesful': 'successful',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'succesfully': 'successfully',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'successfull': 'successful',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'sucessful': 'successful',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'supercede': 'supersede',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'supress': 'suppress',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'supressed': 'suppressed',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'suprise': 'surprise',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'suprisingly': 'surprisingly',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'sytem': 'system',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'tendancy': 'tendency',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'the the': 'the',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'the these': 'these',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'therefor': 'therefore',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'threshhold': 'threshold',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'tolerence': 'tolerance',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'tommorow': 'tomorrow',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'tommorrow': 'tomorrow',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'tounge': 'tongue',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'tranformed': 'transformed',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'transfered': 'transferred',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'truely': 'truly',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'trustworthyness': 'trustworthiness',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'unforseen': 'unforeseen',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'unfortunatly': 'unfortunately',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'unsuccessfull': 'unsuccessful',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'untill': 'until',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'upto': 'up to',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'whereever': 'wherever',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'wich': 'which',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'wierd': 'weird',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello 'wtih': 'with',
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello}
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Melloalternates = {
f3a07f941f1be263a48a040c059edbcb722cf436Cody Peter Mello 'parseable': 'parsable',
1b2031a95889aea96be6af55dcf31a0d5ffdfed9Cody Peter Mello 'sub-command': 'subcommand',
1b2031a95889aea96be6af55dcf31a0d5ffdfed9Cody Peter Mello 'sub-commands': 'subcommands',
831b40b1c811223fd0b1131791a38e3ae5143377Cody Peter Mello 'writeable': 'writable'
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello}
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter MellomisspellingREs = []
71af3be340c57171837478555e2eb0d496318cfcCody Peter MelloalternateREs = []
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mellofor misspelling, correct in misspellings.iteritems():
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello regex = re.compile(r'\b%s\b' % (misspelling), re.IGNORECASE)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello entry = (regex, misspelling, correct)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello misspellingREs.append(entry)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mellofor alternate, correct in alternates.iteritems():
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello regex = re.compile(r'\b%s\b' % (alternate), re.IGNORECASE)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello entry = (regex, alternate, correct)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello alternateREs.append(entry)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mellodef check(errmsg, output, filename, line, lineno, entry):
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello if entry[0].search(line):
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello output.write(errmsg % (filename, lineno, entry[1], entry[2]))
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello return 1
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello else:
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello return 0
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mellodef spellcheck(fh, filename=None, output=sys.stderr, **opts):
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello lineno = 1
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello ret = 0
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello if not filename:
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello filename = fh.name
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello fh.seek(0)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello for line in fh:
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello for entry in misspellingREs:
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello ret |= check(spellMsg, output, filename, line,
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello lineno, entry)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello for entry in alternateREs:
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello ret |= check(altMsg, output, filename, line,
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello lineno, entry)
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello lineno += 1
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello
71af3be340c57171837478555e2eb0d496318cfcCody Peter Mello return ret