| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | # ##### BEGIN GPL LICENSE BLOCK ##### | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  | #  modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  | #  as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  | #  of the License, or (at your option) any later version. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  | #  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  | #  GNU General Public License for more details. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | #  You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | #  along with this program; if not, write to the Free Software Foundation, | 
					
						
							|  |  |  | #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # ##### END GPL LICENSE BLOCK ##### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # <pep8 compliant> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  | import enchant | 
					
						
							|  |  |  | import os | 
					
						
							|  |  |  | import pickle | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | import re | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-29 15:35:06 +11:00
										 |  |  | class SpellChecker: | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  |     A basic spell checker. | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |     # These must be all lower case for comparisons | 
					
						
							|  |  |  |     uimsgs = { | 
					
						
							|  |  |  |         # OK words | 
					
						
							|  |  |  |         "aren",  # aren't | 
					
						
							|  |  |  |         "betweens",  # yuck! in-betweens! | 
					
						
							|  |  |  |         "boolean", "booleans", | 
					
						
							|  |  |  |         "couldn",  # couldn't | 
					
						
							|  |  |  |         "decrement", | 
					
						
							|  |  |  |         "derivate", | 
					
						
							|  |  |  |         "doesn",  # doesn't | 
					
						
							| 
									
										
										
										
											2014-03-19 15:25:10 +01:00
										 |  |  |         "equi",  # equi-angular, etc. | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "fader", | 
					
						
							| 
									
										
										
										
											2013-07-16 13:12:58 +00:00
										 |  |  |         "globbing", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "hasn",  # hasn't | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "hetero", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "hoc",  # ad-hoc | 
					
						
							|  |  |  |         "indices", | 
					
						
							|  |  |  |         "iridas", | 
					
						
							|  |  |  |         "isn",  # isn't | 
					
						
							|  |  |  |         "iterable", | 
					
						
							|  |  |  |         "kyrgyz", | 
					
						
							|  |  |  |         "latin", | 
					
						
							|  |  |  |         "merchantability", | 
					
						
							|  |  |  |         "mplayer", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "pong",  # ping pong | 
					
						
							| 
									
										
										
										
											2013-12-16 21:26:48 +01:00
										 |  |  |         "teleport", "teleporting", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "vertices", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Merged words | 
					
						
							|  |  |  |         "addon", "addons", | 
					
						
							|  |  |  |         "antialiasing", | 
					
						
							|  |  |  |         "arcsine", "arccosine", "arctangent", | 
					
						
							|  |  |  |         "autoclip", | 
					
						
							|  |  |  |         "autocomplete", | 
					
						
							| 
									
										
										
										
											2013-06-17 10:01:35 +00:00
										 |  |  |         "autoexec", | 
					
						
							| 
									
										
										
										
											2013-07-16 13:12:58 +00:00
										 |  |  |         "autoexecution", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "autoname", | 
					
						
							| 
									
										
										
										
											2014-01-21 20:18:07 +01:00
										 |  |  |         "autopack", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "autosave", | 
					
						
							|  |  |  |         "autoscale", | 
					
						
							|  |  |  |         "autosmooth", | 
					
						
							|  |  |  |         "autosplit", | 
					
						
							|  |  |  |         "backface", "backfacing", | 
					
						
							|  |  |  |         "backimage", | 
					
						
							|  |  |  |         "backscattered", | 
					
						
							|  |  |  |         "bandnoise", | 
					
						
							|  |  |  |         "bindcode", | 
					
						
							| 
									
										
										
										
											2013-09-09 20:22:01 +00:00
										 |  |  |         "bitflag", "bitflags", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "bitrate", | 
					
						
							| 
									
										
										
										
											2013-08-06 14:55:00 +00:00
										 |  |  |         "blackbody", | 
					
						
							| 
									
										
										
										
											2013-03-11 15:01:03 +00:00
										 |  |  |         "blendfile", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "blendin", | 
					
						
							|  |  |  |         "bonesize", | 
					
						
							|  |  |  |         "boundbox", | 
					
						
							|  |  |  |         "boxpack", | 
					
						
							|  |  |  |         "buffersize", | 
					
						
							|  |  |  |         "builtin", "builtins", | 
					
						
							|  |  |  |         "bytecode", | 
					
						
							|  |  |  |         "chunksize", | 
					
						
							| 
									
										
										
										
											2013-03-11 09:06:49 +00:00
										 |  |  |         "customdata", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "dataset", "datasets", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "de", | 
					
						
							| 
									
										
										
										
											2015-07-14 21:41:24 +02:00
										 |  |  |         "deadzone", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "deconstruct", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "defocus", | 
					
						
							|  |  |  |         "denoise", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "deselect", "deselecting", "deselection", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "despill", "despilling", | 
					
						
							| 
									
										
										
										
											2015-08-25 21:12:36 +02:00
										 |  |  |         "dirtree", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "editcurve", | 
					
						
							|  |  |  |         "editmesh", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "filebrowser", | 
					
						
							|  |  |  |         "filelist", | 
					
						
							|  |  |  |         "filename", "filenames", | 
					
						
							|  |  |  |         "filepath", "filepaths", | 
					
						
							|  |  |  |         "forcefield", "forcefields", | 
					
						
							|  |  |  |         "fulldome", "fulldomes", | 
					
						
							|  |  |  |         "fullscreen", | 
					
						
							|  |  |  |         "gridline", | 
					
						
							|  |  |  |         "hemi", | 
					
						
							|  |  |  |         "inbetween", | 
					
						
							|  |  |  |         "inscatter", "inscattering", | 
					
						
							|  |  |  |         "libdata", | 
					
						
							|  |  |  |         "lightless", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "lineset", | 
					
						
							| 
									
										
										
										
											2015-08-25 21:12:36 +02:00
										 |  |  |         "linestyle", "linestyles", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "localview", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "lookup", "lookups", | 
					
						
							|  |  |  |         "mathutils", | 
					
						
							|  |  |  |         "midlevel", | 
					
						
							|  |  |  |         "midground", | 
					
						
							|  |  |  |         "mixdown", | 
					
						
							|  |  |  |         "multi", | 
					
						
							|  |  |  |         "multifractal", | 
					
						
							|  |  |  |         "multires", "multiresolution", | 
					
						
							|  |  |  |         "multisampling", | 
					
						
							|  |  |  |         "multitexture", | 
					
						
							|  |  |  |         "multiuser", | 
					
						
							| 
									
										
										
										
											2015-04-06 20:43:34 +02:00
										 |  |  |         "multiview", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "namespace", | 
					
						
							| 
									
										
										
										
											2015-08-25 21:12:36 +02:00
										 |  |  |         "nodetree", "nodetrees", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "keyconfig", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "online", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "playhead", | 
					
						
							|  |  |  |         "popup", "popups", | 
					
						
							|  |  |  |         "pre", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "precache", "precaching", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "precalculate", | 
					
						
							|  |  |  |         "prefetch", | 
					
						
							|  |  |  |         "premultiply", "premultiplied", | 
					
						
							|  |  |  |         "prepass", | 
					
						
							|  |  |  |         "prepend", | 
					
						
							|  |  |  |         "preprocess", "preprocessing", | 
					
						
							|  |  |  |         "preseek", | 
					
						
							| 
									
										
										
										
											2014-05-26 20:12:03 +02:00
										 |  |  |         "promillage", | 
					
						
							| 
									
										
										
										
											2014-05-12 23:08:31 +02:00
										 |  |  |         "pushdown", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "raytree", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "readonly", | 
					
						
							|  |  |  |         "realtime", | 
					
						
							|  |  |  |         "rekey", | 
					
						
							|  |  |  |         "remesh", | 
					
						
							|  |  |  |         "reprojection", | 
					
						
							|  |  |  |         "resize", | 
					
						
							|  |  |  |         "restpose", | 
					
						
							|  |  |  |         "retarget", "retargets", "retargeting", "retargeted", | 
					
						
							| 
									
										
										
										
											2013-04-29 14:09:19 +00:00
										 |  |  |         "rigidbody", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "ringnoise", | 
					
						
							|  |  |  |         "rolloff", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "runtime", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "screencast", "screenshot", "screenshots", | 
					
						
							|  |  |  |         "selfcollision", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "shadowbuffer", "shadowbuffers", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "singletexture", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "spellcheck", "spellchecking", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "startup", | 
					
						
							|  |  |  |         "stateful", | 
					
						
							|  |  |  |         "starfield", | 
					
						
							|  |  |  |         "subflare", "subflares", | 
					
						
							|  |  |  |         "subframe", "subframes", | 
					
						
							|  |  |  |         "subclass", "subclasses", "subclassing", | 
					
						
							|  |  |  |         "subdirectory", "subdirectories", "subdir", "subdirs", | 
					
						
							|  |  |  |         "submodule", "submodules", | 
					
						
							|  |  |  |         "subpath", | 
					
						
							|  |  |  |         "subsize", | 
					
						
							|  |  |  |         "substep", "substeps", | 
					
						
							|  |  |  |         "targetless", | 
					
						
							|  |  |  |         "textbox", "textboxes", | 
					
						
							|  |  |  |         "tilemode", | 
					
						
							|  |  |  |         "timestamp", "timestamps", | 
					
						
							|  |  |  |         "timestep", "timesteps", | 
					
						
							|  |  |  |         "todo", | 
					
						
							|  |  |  |         "un", | 
					
						
							|  |  |  |         "unbake", | 
					
						
							|  |  |  |         "uncomment", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "unculled", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "undeformed", | 
					
						
							|  |  |  |         "undistort", "undistortion", | 
					
						
							| 
									
										
										
										
											2013-03-18 18:43:22 +00:00
										 |  |  |         "ungroup", "ungrouped", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "unhide", | 
					
						
							|  |  |  |         "unindent", | 
					
						
							|  |  |  |         "unkeyed", | 
					
						
							| 
									
										
										
										
											2015-06-15 21:38:09 +02:00
										 |  |  |         "unmute", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "unpremultiply", | 
					
						
							|  |  |  |         "unprojected", | 
					
						
							|  |  |  |         "unreacted", | 
					
						
							|  |  |  |         "unregister", | 
					
						
							| 
									
										
										
										
											2013-12-16 21:26:48 +01:00
										 |  |  |         "unselected", "unselectable", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "unsubdivided", "unsubdivide", | 
					
						
							|  |  |  |         "unshadowed", | 
					
						
							|  |  |  |         "unspill", | 
					
						
							|  |  |  |         "unstitchable", | 
					
						
							|  |  |  |         "vectorscope", | 
					
						
							|  |  |  |         "whitespace", "whitespaces", | 
					
						
							|  |  |  |         "worldspace", | 
					
						
							|  |  |  |         "workflow", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Neologisms, slangs | 
					
						
							|  |  |  |         "affectable", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "animatable", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "automagic", "automagically", | 
					
						
							|  |  |  |         "blobby", | 
					
						
							|  |  |  |         "blockiness", "blocky", | 
					
						
							|  |  |  |         "collider", "colliders", | 
					
						
							|  |  |  |         "deformer", "deformers", | 
					
						
							|  |  |  |         "determinator", | 
					
						
							|  |  |  |         "editability", | 
					
						
							|  |  |  |         "keyer", | 
					
						
							|  |  |  |         "lacunarity", | 
					
						
							|  |  |  |         "numerics", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "occluder", "occluders", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "passepartout", | 
					
						
							|  |  |  |         "perspectively", | 
					
						
							|  |  |  |         "pixelate", | 
					
						
							| 
									
										
										
										
											2015-02-16 20:00:20 +01:00
										 |  |  |         "pointiness", | 
					
						
							| 
									
										
										
										
											2014-06-30 20:42:44 +02:00
										 |  |  |         "polycount", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "polygonization", "polygonalization",  # yuck! | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "selectability", | 
					
						
							|  |  |  |         "stitchable", | 
					
						
							|  |  |  |         "symmetrize", | 
					
						
							|  |  |  |         "trackability", | 
					
						
							|  |  |  |         "transmissivity", | 
					
						
							|  |  |  |         "rasterized", "rasterization", "rasterizer", | 
					
						
							|  |  |  |         "renderer", "renderable", "renderability", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         # Really bad!!! | 
					
						
							|  |  |  |         "convertor", | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Abbreviations | 
					
						
							|  |  |  |         "aero", | 
					
						
							|  |  |  |         "amb", | 
					
						
							|  |  |  |         "anim", | 
					
						
							|  |  |  |         "bool", | 
					
						
							|  |  |  |         "calc", | 
					
						
							|  |  |  |         "config", "configs", | 
					
						
							|  |  |  |         "const", | 
					
						
							|  |  |  |         "coord", "coords", | 
					
						
							|  |  |  |         "degr", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "diff", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "dof", | 
					
						
							|  |  |  |         "dupli", "duplis", | 
					
						
							|  |  |  |         "eg", | 
					
						
							|  |  |  |         "esc", | 
					
						
							|  |  |  |         "expr", | 
					
						
							|  |  |  |         "fac", | 
					
						
							|  |  |  |         "fra", | 
					
						
							|  |  |  |         "frs", | 
					
						
							|  |  |  |         "grless", | 
					
						
							|  |  |  |         "http", | 
					
						
							|  |  |  |         "init", | 
					
						
							|  |  |  |         "kbit", "kb", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "lang", "langs", | 
					
						
							|  |  |  |         "lclick", "rclick", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "lensdist", | 
					
						
							|  |  |  |         "loc", "rot", "pos", | 
					
						
							|  |  |  |         "lorem", | 
					
						
							|  |  |  |         "luma", | 
					
						
							| 
									
										
										
										
											2015-07-14 21:41:24 +02:00
										 |  |  |         "mbs",  # mouse button 'select'. | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "mem", | 
					
						
							|  |  |  |         "multicam", | 
					
						
							|  |  |  |         "num", | 
					
						
							|  |  |  |         "ok", | 
					
						
							|  |  |  |         "orco", | 
					
						
							|  |  |  |         "ortho", | 
					
						
							| 
									
										
										
										
											2014-12-29 21:55:51 +01:00
										 |  |  |         "pano", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "persp", | 
					
						
							|  |  |  |         "pref", "prefs", | 
					
						
							|  |  |  |         "prev", | 
					
						
							|  |  |  |         "param", | 
					
						
							|  |  |  |         "premul", | 
					
						
							|  |  |  |         "quad", "quads", | 
					
						
							|  |  |  |         "quat", "quats", | 
					
						
							|  |  |  |         "recalc", "recalcs", | 
					
						
							|  |  |  |         "refl", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "sce", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "sel", | 
					
						
							|  |  |  |         "spec", | 
					
						
							|  |  |  |         "struct", "structs", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "sys", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "tex", | 
					
						
							| 
									
										
										
										
											2015-07-14 21:41:24 +02:00
										 |  |  |         "tmr",  # timer | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "tri", "tris", | 
					
						
							|  |  |  |         "uv", "uvs", "uvw", "uw", "uvmap", | 
					
						
							| 
									
										
										
										
											2013-03-10 16:55:01 +00:00
										 |  |  |         "ve", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "vec", | 
					
						
							|  |  |  |         "vel",  # velocity! | 
					
						
							|  |  |  |         "vert", "verts", | 
					
						
							|  |  |  |         "vis", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "xor", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "xyz", "xzy", "yxz", "yzx", "zxy", "zyx", | 
					
						
							|  |  |  |         "xy", "xz", "yx", "yz", "zx", "zy", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # General computer/science terms | 
					
						
							| 
									
										
										
										
											2014-01-21 20:18:07 +01:00
										 |  |  |         "bitangent", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "boid", "boids", | 
					
						
							|  |  |  |         "equisolid", | 
					
						
							|  |  |  |         "euler", "eulers", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "fribidi", | 
					
						
							|  |  |  |         "gettext", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "hashable", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "hotspot", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "intrinsics", | 
					
						
							|  |  |  |         "isosurface", | 
					
						
							|  |  |  |         "jitter", "jittering", "jittered", | 
					
						
							|  |  |  |         "keymap", "keymaps", | 
					
						
							|  |  |  |         "lambertian", | 
					
						
							|  |  |  |         "laplacian", | 
					
						
							|  |  |  |         "metadata", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "msgfmt", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "nand", "xnor", | 
					
						
							|  |  |  |         "normals", | 
					
						
							|  |  |  |         "numpad", | 
					
						
							|  |  |  |         "octree", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "omnidirectional", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "opengl", | 
					
						
							| 
									
										
										
										
											2014-03-31 21:15:56 +02:00
										 |  |  |         "openmp", | 
					
						
							| 
									
										
										
										
											2014-06-09 21:52:10 +02:00
										 |  |  |         "photoreceptor", | 
					
						
							|  |  |  |         "poly", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "polyline", "polylines", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "pulldown", "pulldowns", | 
					
						
							|  |  |  |         "quantized", | 
					
						
							|  |  |  |         "samplerate", | 
					
						
							|  |  |  |         "scrollback", | 
					
						
							|  |  |  |         "scrollbar", | 
					
						
							|  |  |  |         "scroller", | 
					
						
							|  |  |  |         "searchable", | 
					
						
							|  |  |  |         "spacebar", | 
					
						
							|  |  |  |         "tooltip", "tooltips", | 
					
						
							|  |  |  |         "trackpad", | 
					
						
							| 
									
										
										
										
											2013-04-02 07:27:39 +00:00
										 |  |  |         "tuple", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "unicode", | 
					
						
							|  |  |  |         "viewport", "viewports", | 
					
						
							|  |  |  |         "viscoelastic", | 
					
						
							|  |  |  |         "wildcard", "wildcards", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # General computer graphics terms | 
					
						
							|  |  |  |         "anaglyph", | 
					
						
							|  |  |  |         "bezier", "beziers", | 
					
						
							|  |  |  |         "bicubic", | 
					
						
							|  |  |  |         "bilinear", | 
					
						
							| 
									
										
										
										
											2014-03-19 15:25:10 +01:00
										 |  |  |         "binormal", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "blackpoint", "whitepoint", | 
					
						
							|  |  |  |         "blinn", | 
					
						
							|  |  |  |         "bokeh", | 
					
						
							|  |  |  |         "catadioptric", | 
					
						
							|  |  |  |         "centroid", | 
					
						
							|  |  |  |         "chrominance", | 
					
						
							|  |  |  |         "codec", "codecs", | 
					
						
							|  |  |  |         "collada", | 
					
						
							|  |  |  |         "compositing", | 
					
						
							|  |  |  |         "crossfade", | 
					
						
							|  |  |  |         "deinterlace", | 
					
						
							|  |  |  |         "dropoff", | 
					
						
							|  |  |  |         "dv", | 
					
						
							|  |  |  |         "eigenvectors", | 
					
						
							|  |  |  |         "equirectangular", | 
					
						
							|  |  |  |         "fisheye", | 
					
						
							|  |  |  |         "framerate", | 
					
						
							|  |  |  |         "gimbal", | 
					
						
							|  |  |  |         "grayscale", | 
					
						
							|  |  |  |         "icosphere", | 
					
						
							|  |  |  |         "inpaint", | 
					
						
							|  |  |  |         "lightmap", | 
					
						
							| 
									
										
										
										
											2014-07-23 20:59:13 +02:00
										 |  |  |         "linearlight", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "lossless", "lossy", | 
					
						
							|  |  |  |         "matcap", | 
					
						
							|  |  |  |         "midtones", | 
					
						
							|  |  |  |         "mipmap", "mipmaps", "mip", | 
					
						
							|  |  |  |         "ngon", "ngons", | 
					
						
							|  |  |  |         "ntsc", | 
					
						
							|  |  |  |         "nurb", "nurbs", | 
					
						
							|  |  |  |         "perlin", | 
					
						
							|  |  |  |         "phong", | 
					
						
							| 
									
										
										
										
											2014-07-23 20:59:13 +02:00
										 |  |  |         "pinlight", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "qi", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "radiosity", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "raycasting", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "raytrace", "raytracing", "raytraced", | 
					
						
							|  |  |  |         "renderfarm", | 
					
						
							| 
									
										
										
										
											2013-12-16 21:26:48 +01:00
										 |  |  |         "scanfill", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "shader", "shaders", | 
					
						
							| 
									
										
										
										
											2014-07-23 20:59:13 +02:00
										 |  |  |         "softlight", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "specular", "specularity", | 
					
						
							|  |  |  |         "spillmap", | 
					
						
							|  |  |  |         "sobel", | 
					
						
							| 
									
										
										
										
											2014-03-19 15:25:10 +01:00
										 |  |  |         "texel", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "tonemap", | 
					
						
							|  |  |  |         "toon", | 
					
						
							|  |  |  |         "timecode", | 
					
						
							| 
									
										
										
										
											2014-07-23 20:59:13 +02:00
										 |  |  |         "vividlight", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "voronoi", | 
					
						
							|  |  |  |         "voxel", "voxels", | 
					
						
							| 
									
										
										
										
											2013-08-06 14:55:00 +00:00
										 |  |  |         "vsync", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "wireframe", | 
					
						
							|  |  |  |         "zmask", | 
					
						
							|  |  |  |         "ztransp", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Blender terms | 
					
						
							|  |  |  |         "audaspace", | 
					
						
							|  |  |  |         "bbone", | 
					
						
							|  |  |  |         "breakdowner", | 
					
						
							|  |  |  |         "bspline", | 
					
						
							|  |  |  |         "bweight", | 
					
						
							|  |  |  |         "colorband", | 
					
						
							|  |  |  |         "datablock", "datablocks", | 
					
						
							|  |  |  |         "despeckle", | 
					
						
							|  |  |  |         "dopesheet", | 
					
						
							|  |  |  |         "dupliface", "duplifaces", | 
					
						
							|  |  |  |         "dupliframe", "dupliframes", | 
					
						
							|  |  |  |         "dupliobject", "dupliob", | 
					
						
							|  |  |  |         "dupligroup", | 
					
						
							|  |  |  |         "duplivert", | 
					
						
							| 
									
										
										
										
											2014-03-25 21:16:28 +01:00
										 |  |  |         "dyntopo", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "editbone", | 
					
						
							|  |  |  |         "editmode", | 
					
						
							|  |  |  |         "fcurve", "fcurves", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "fedge", "fedges", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "fluidsim", | 
					
						
							|  |  |  |         "frameserver", | 
					
						
							| 
									
										
										
										
											2013-04-07 10:21:22 +00:00
										 |  |  |         "freestyle", | 
					
						
							|  |  |  |         "enum", "enums", | 
					
						
							| 
									
										
										
										
											2013-03-26 14:33:53 +00:00
										 |  |  |         "gpencil", | 
					
						
							| 
									
										
										
										
											2013-03-25 08:30:38 +00:00
										 |  |  |         "idcol", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "keyframe", "keyframes", "keyframing", "keyframed", | 
					
						
							| 
									
										
										
										
											2013-03-25 08:30:38 +00:00
										 |  |  |         "metaball", "metaballs", "mball", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "metaelement", "metaelements", | 
					
						
							|  |  |  |         "metastrip", "metastrips", | 
					
						
							|  |  |  |         "movieclip", | 
					
						
							|  |  |  |         "mpoly", | 
					
						
							|  |  |  |         "mtex", | 
					
						
							|  |  |  |         "nabla", | 
					
						
							|  |  |  |         "navmesh", | 
					
						
							|  |  |  |         "outliner", | 
					
						
							|  |  |  |         "paintmap", "paintmaps", | 
					
						
							|  |  |  |         "polygroup", "polygroups", | 
					
						
							|  |  |  |         "poselib", | 
					
						
							|  |  |  |         "pushpull", | 
					
						
							|  |  |  |         "pyconstraint", "pyconstraints", | 
					
						
							| 
									
										
										
										
											2014-03-19 15:25:10 +01:00
										 |  |  |         "qe",  # keys... | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "shapekey", "shapekeys", | 
					
						
							|  |  |  |         "shrinkfatten", | 
					
						
							|  |  |  |         "shrinkwrap", | 
					
						
							|  |  |  |         "softbody", | 
					
						
							|  |  |  |         "stucci", | 
					
						
							|  |  |  |         "sunsky", | 
					
						
							|  |  |  |         "subsurf", | 
					
						
							|  |  |  |         "tessface", "tessfaces", | 
					
						
							|  |  |  |         "texface", | 
					
						
							|  |  |  |         "timeline", "timelines", | 
					
						
							|  |  |  |         "tosphere", | 
					
						
							|  |  |  |         "uilist", | 
					
						
							|  |  |  |         "vcol", "vcols", | 
					
						
							|  |  |  |         "vgroup", "vgroups", | 
					
						
							|  |  |  |         "vinterlace", | 
					
						
							| 
									
										
										
										
											2015-01-19 20:49:36 +01:00
										 |  |  |         "vse", | 
					
						
							| 
									
										
										
										
											2014-03-19 15:25:10 +01:00
										 |  |  |         "wasd", "wasdqe",  # keys... | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "wetmap", "wetmaps", | 
					
						
							|  |  |  |         "wpaint", | 
					
						
							|  |  |  |         "uvwarp", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Algorithm names | 
					
						
							| 
									
										
										
										
											2014-06-30 20:42:44 +02:00
										 |  |  |         "ashikhmin",  # Ashikhmin-Shirley | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "beckmann", | 
					
						
							|  |  |  |         "catmull", | 
					
						
							|  |  |  |         "catrom", | 
					
						
							|  |  |  |         "chebychev", | 
					
						
							|  |  |  |         "courant", | 
					
						
							| 
									
										
										
										
											2013-09-09 20:22:01 +00:00
										 |  |  |         "hosek", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "kutta", | 
					
						
							|  |  |  |         "lennard", | 
					
						
							| 
									
										
										
										
											2014-01-21 20:18:07 +01:00
										 |  |  |         "mikktspace", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "minkowski", | 
					
						
							|  |  |  |         "minnaert", | 
					
						
							|  |  |  |         "musgrave", | 
					
						
							|  |  |  |         "nayar", | 
					
						
							|  |  |  |         "netravali", | 
					
						
							|  |  |  |         "oren", | 
					
						
							| 
									
										
										
										
											2013-09-09 20:22:01 +00:00
										 |  |  |         "preetham", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "prewitt", | 
					
						
							|  |  |  |         "runge", | 
					
						
							| 
									
										
										
										
											2013-06-17 10:01:35 +00:00
										 |  |  |         "sobol", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "verlet", | 
					
						
							| 
									
										
										
										
											2013-09-09 20:22:01 +00:00
										 |  |  |         "wilkie", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "worley", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Acronyms | 
					
						
							|  |  |  |         "aa", "msaa", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "ao", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "api", | 
					
						
							|  |  |  |         "asc", "cdl", | 
					
						
							|  |  |  |         "ascii", | 
					
						
							|  |  |  |         "atrac", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "bsdf", | 
					
						
							| 
									
										
										
										
											2013-04-02 07:27:39 +00:00
										 |  |  |         "bssrdf", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "bw", | 
					
						
							|  |  |  |         "ccd", | 
					
						
							|  |  |  |         "cmd", | 
					
						
							|  |  |  |         "cpus", | 
					
						
							|  |  |  |         "ctrl", | 
					
						
							|  |  |  |         "cw", "ccw", | 
					
						
							|  |  |  |         "dev", | 
					
						
							|  |  |  |         "djv", | 
					
						
							|  |  |  |         "dpi", | 
					
						
							|  |  |  |         "dvar", | 
					
						
							|  |  |  |         "dx", | 
					
						
							|  |  |  |         "eo", | 
					
						
							|  |  |  |         "fh", | 
					
						
							|  |  |  |         "fov", | 
					
						
							|  |  |  |         "fft", | 
					
						
							|  |  |  |         "futura", | 
					
						
							| 
									
										
										
										
											2015-02-16 20:00:20 +01:00
										 |  |  |         "fx", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "gfx", | 
					
						
							|  |  |  |         "gl", | 
					
						
							|  |  |  |         "glsl", | 
					
						
							|  |  |  |         "gpl", | 
					
						
							|  |  |  |         "gpu", "gpus", | 
					
						
							|  |  |  |         "hc", | 
					
						
							|  |  |  |         "hdc", | 
					
						
							|  |  |  |         "hdr", | 
					
						
							|  |  |  |         "hh", "mm", "ss", "ff",  # hh:mm:ss:ff timecode | 
					
						
							| 
									
										
										
										
											2014-03-19 15:25:10 +01:00
										 |  |  |         "hsv", "hsva", "hsl", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "id", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "ior", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "itu", | 
					
						
							|  |  |  |         "lhs", | 
					
						
							|  |  |  |         "lmb", "mmb", "rmb", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "kb", | 
					
						
							|  |  |  |         "mocap", | 
					
						
							|  |  |  |         "msgid", "msgids", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "mux", | 
					
						
							|  |  |  |         "ndof", | 
					
						
							|  |  |  |         "ppc", | 
					
						
							|  |  |  |         "precisa", | 
					
						
							|  |  |  |         "px", | 
					
						
							|  |  |  |         "qmc", | 
					
						
							|  |  |  |         "rgb", "rgba", | 
					
						
							|  |  |  |         "rhs", | 
					
						
							|  |  |  |         "rv", | 
					
						
							|  |  |  |         "sdl", | 
					
						
							|  |  |  |         "sl", | 
					
						
							|  |  |  |         "smpte", | 
					
						
							| 
									
										
										
										
											2015-02-16 20:00:20 +01:00
										 |  |  |         "ssao", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "svn", | 
					
						
							|  |  |  |         "ui", | 
					
						
							|  |  |  |         "unix", | 
					
						
							|  |  |  |         "vbo", "vbos", | 
					
						
							|  |  |  |         "ycc", "ycca", | 
					
						
							|  |  |  |         "yuv", "yuva", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Blender acronyms | 
					
						
							|  |  |  |         "bge", | 
					
						
							|  |  |  |         "bli", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "bpy", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "bvh", | 
					
						
							|  |  |  |         "dbvt", | 
					
						
							|  |  |  |         "dop",  # BLI K-Dop BVH | 
					
						
							|  |  |  |         "ik", | 
					
						
							|  |  |  |         "nla", | 
					
						
							|  |  |  |         "py", | 
					
						
							|  |  |  |         "qbvh", | 
					
						
							|  |  |  |         "rna", | 
					
						
							|  |  |  |         "rvo", | 
					
						
							|  |  |  |         "simd", | 
					
						
							|  |  |  |         "sph", | 
					
						
							|  |  |  |         "svbvh", | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         # Files types/formats | 
					
						
							|  |  |  |         "avi", | 
					
						
							|  |  |  |         "attrac", | 
					
						
							|  |  |  |         "autocad", | 
					
						
							|  |  |  |         "autodesk", | 
					
						
							|  |  |  |         "bmp", | 
					
						
							|  |  |  |         "btx", | 
					
						
							|  |  |  |         "cineon", | 
					
						
							|  |  |  |         "dpx", | 
					
						
							| 
									
										
										
										
											2015-03-16 20:51:02 +01:00
										 |  |  |         "dwaa", | 
					
						
							|  |  |  |         "dwab", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "dxf", | 
					
						
							|  |  |  |         "eps", | 
					
						
							|  |  |  |         "exr", | 
					
						
							|  |  |  |         "fbx", | 
					
						
							|  |  |  |         "ffmpeg", | 
					
						
							|  |  |  |         "flac", | 
					
						
							|  |  |  |         "gzip", | 
					
						
							|  |  |  |         "ico", | 
					
						
							|  |  |  |         "jpg", "jpeg", | 
					
						
							| 
									
										
										
										
											2013-02-28 15:31:20 +00:00
										 |  |  |         "json", | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |         "matroska", | 
					
						
							|  |  |  |         "mdd", | 
					
						
							|  |  |  |         "mkv", | 
					
						
							|  |  |  |         "mpeg", "mjpeg", | 
					
						
							|  |  |  |         "mtl", | 
					
						
							|  |  |  |         "ogg", | 
					
						
							|  |  |  |         "openjpeg", | 
					
						
							|  |  |  |         "osl", | 
					
						
							|  |  |  |         "oso", | 
					
						
							|  |  |  |         "piz", | 
					
						
							|  |  |  |         "png", | 
					
						
							|  |  |  |         "po", | 
					
						
							|  |  |  |         "quicktime", | 
					
						
							|  |  |  |         "rle", | 
					
						
							|  |  |  |         "sgi", | 
					
						
							|  |  |  |         "stl", | 
					
						
							|  |  |  |         "svg", | 
					
						
							|  |  |  |         "targa", "tga", | 
					
						
							|  |  |  |         "tiff", | 
					
						
							|  |  |  |         "theora", | 
					
						
							|  |  |  |         "vorbis", | 
					
						
							|  |  |  |         "wav", | 
					
						
							|  |  |  |         "xiph", | 
					
						
							|  |  |  |         "xml", | 
					
						
							|  |  |  |         "xna", | 
					
						
							|  |  |  |         "xvid", | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |     _valid_before = "(?<=[\\s*'\"`])|(?<=[a-zA-Z][/-])|(?<=^)" | 
					
						
							|  |  |  |     _valid_after = "(?=[\\s'\"`.!?,;:])|(?=[/-]\\s*[a-zA-Z])|(?=$)" | 
					
						
							|  |  |  |     _valid_words = "(?:{})(?:(?:[A-Z]+[a-z]*)|[A-Z]*|[a-z]*)(?:{})".format(_valid_before, _valid_after) | 
					
						
							|  |  |  |     _split_words = re.compile(_valid_words).findall | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def split_words(cls, text): | 
					
						
							|  |  |  |         return [w for w in cls._split_words(text) if w] | 
					
						
							| 
									
										
										
										
											2012-07-02 19:51:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-24 08:50:55 +00:00
										 |  |  |     def __init__(self, settings, lang="en_US"): | 
					
						
							|  |  |  |         self.settings = settings | 
					
						
							|  |  |  |         self.dict_spelling = enchant.Dict(lang) | 
					
						
							|  |  |  |         self.cache = set(self.uimsgs) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         cache = self.settings.SPELL_CACHE | 
					
						
							|  |  |  |         if cache and os.path.exists(cache): | 
					
						
							|  |  |  |             with open(cache, 'rb') as f: | 
					
						
							|  |  |  |                 self.cache |= set(pickle.load(f)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def __del__(self): | 
					
						
							|  |  |  |         cache = self.settings.SPELL_CACHE | 
					
						
							|  |  |  |         if cache and os.path.exists(cache): | 
					
						
							|  |  |  |             with open(cache, 'wb') as f: | 
					
						
							|  |  |  |                 pickle.dump(self.cache, f) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def check(self, txt): | 
					
						
							|  |  |  |         ret = [] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if txt in self.cache: | 
					
						
							|  |  |  |             return ret | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for w in self.split_words(txt): | 
					
						
							|  |  |  |             w_lower = w.lower() | 
					
						
							|  |  |  |             if w_lower in self.cache: | 
					
						
							|  |  |  |                 continue | 
					
						
							|  |  |  |             if not self.dict_spelling.check(w): | 
					
						
							|  |  |  |                 ret.append((w, self.dict_spelling.suggest(w))) | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 self.cache.add(w_lower) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if not ret: | 
					
						
							|  |  |  |             self.cache.add(txt) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return ret |