From ad4003537239b96bd1eab4df7c308de191ccbd04 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 17:38:55 +0000 Subject: [PATCH] Fix spelling errors in documentation --- .../docs/optimizing/Module-Splitting.rst | 2 +- .../Interacting-with-code.rst | 4 +- site/source/docs/tools_reference/emcc.rst | 2 +- site/source/docs/tools_reference/emsdk.rst | 2 +- .../tools_reference/settings_reference.rst | 4 +- spell_check.py | 239 ++++++++++++++++++ spell_check.sh | 128 ++++++++++ 7 files changed, 374 insertions(+), 7 deletions(-) create mode 100644 spell_check.py create mode 100755 spell_check.sh diff --git a/site/source/docs/optimizing/Module-Splitting.rst b/site/source/docs/optimizing/Module-Splitting.rst index c7ec126babb53..13bd3f38b6271 100644 --- a/site/source/docs/optimizing/Module-Splitting.rst +++ b/site/source/docs/optimizing/Module-Splitting.rst @@ -233,7 +233,7 @@ prevent the program from clobbering that memory region. After splitting, multithreaded applications will currently fetch and compile the secondary module separately on each thread. The compiled secondary module is not -postmessaged to each thread the way the Emscripten postmessages the primary +post-messaged to each thread the way the Emscripten post-messages the primary module to the threads. This is not as bad as it sounds because downloads of the secondary module from workers will be serviced from the cache if the appropriate Cache-Control headers are set, but improving this is an area for future work. diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index 7676b1ab28528..424a4d8c1011b 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -29,7 +29,7 @@ JavaScript and compiled C or C++: - :ref:`Access compiled code memory from JavaScript `. -- :ref:`Affect execution behaviour `. +- :ref:`Affect execution behavior `. - :ref:`Access environment variables `. This article explains each of the methods listed above, and provides links @@ -37,7 +37,7 @@ to more detailed information. .. note:: For information on how compiled code interacts with the browser environment, see :ref:`emscripten-runtime-environment`. For file system - related manners, see the :ref:`file-system-overview`. + related matters, see the :ref:`file-system-overview`. .. note:: Before you can call your code, the runtime environment may need to load a memory initialization file, preload files, or diff --git a/site/source/docs/tools_reference/emcc.rst b/site/source/docs/tools_reference/emcc.rst index 266b3d5ed6ba6..aed1d73f336b8 100644 --- a/site/source/docs/tools_reference/emcc.rst +++ b/site/source/docs/tools_reference/emcc.rst @@ -252,7 +252,7 @@ Options that are modified or new in *emcc* are listed below: ``--emit-minification-map `` [link] - In cases where emscripten performs import/export minificiton this option can + In cases where emscripten performs import/export minification this option can be used to output a file that maps minified names back to their original names. The format of this file is single line per import/export of the form ``:``. diff --git a/site/source/docs/tools_reference/emsdk.rst b/site/source/docs/tools_reference/emsdk.rst index 3e077332d26c9..cb78634b35e8d 100644 --- a/site/source/docs/tools_reference/emsdk.rst +++ b/site/source/docs/tools_reference/emsdk.rst @@ -287,7 +287,7 @@ It is also possible to use your own fork of the Emscripten repository via the SDK. This is useful in the case when you want to make your own modifications to the Emscripten toolchain, but still keep using the SDK environment and tools. -To to this all you need to do is set the ``EM_CONFIG`` environment variable to +To do this all you need to do is set the ``EM_CONFIG`` environment variable to point to the emsdk emscripten config and then put your own checkout of emscripten first in the ``PATH``: diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index 1f942d8ef13d0..d6cf1c23e2dac 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -125,7 +125,7 @@ What malloc()/free() to use, out of: - emmalloc-verbose - use emmalloc with assertions + verbose logging. - emmalloc-memvalidate-verbose - use emmalloc with assertions + heap consistency checking + verbose logging. - - mimalloc - a powerful mulithreaded allocator. This is recommended in + - mimalloc - a powerful multithreaded allocator. This is recommended in large applications that have malloc() contention, but it is larger and uses more memory. - none - no malloc() implementation is provided, but you must implement @@ -3164,7 +3164,7 @@ overhead for the extra instrumented function indirection. Enable this if you want Emscripten to handle unhandled exceptions nicely at the cost of a few bytes extra. Exceptions that occur within the ``main`` function are already handled via an -alternative mechanimsm. +alternative mechanism. Default value: false diff --git a/spell_check.py b/spell_check.py new file mode 100644 index 0000000000000..cf31dd1529e95 --- /dev/null +++ b/spell_check.py @@ -0,0 +1,239 @@ +import enchant +import re + +# Excluded words (case-insensitive) +EXCLUDED_WORDS = { + "asan", "binaryen", "codexl", "cordova", "dce", "dlmalloc", "emcc", "emcmdprompt", + "emrun", "emsdk", "emscripten", "github", "js", "llvm", "lsc", "minifying", + "minification", "multithreaded", "node.js", "pre-js", "pthreads", "pyenchant", + "relooping", "sdk", "subdirectories", "toolchain", "ubsan", "wasm", "webgl", + "webassembly", "xhr", "xhrs", "wasi", "wasi-sdk", "wasm-ld", "wasm-opt", + "wasm-sourcemap", "wasm2js", "webgpu", "websockets", "websocket", "webidl", + "webviews", "webview", "worklet", "worklets", "emmalloc", "mimalloc", "post-js", + "sourcemap", "subprotocol", "offscreencanvas", "offscreencanvases", "webgl2", + "webgpu", "emdawnwebgpu", "harfbuzz", "libjpeg", "libpng", "mpg123", "sd", + "sdl", "sdl2", "sdl_gfx", "sdl_image", "sdl_mixer", "sdl_net", "sdl_ttf", + "sqlite3", "vorbis", "zlib", "bzip2", "cocos2d", "freetype", "giflib", "icu", + "modplug", "ogg", "regal", "boost", "bullet", "pre-run", "pre-init", + "pre-main", "pre-exit", "pre-memory-init", "pre-memory-growth", + "pre-memory-resize", "pre-memory-snapshot", "pre-memory-restore", + "pre-memory-request", "pre-memory-commit", "pre-memory-decommit", + "pre-memory-remap", "pre-memory-unmap", "pre-memory-protect", + "pre-memory-lock", "pre-memory-unlock", "pre-memory-advise", "pre-memory-madvise", + "pre-memory-msync", "pre-memory-mlock", "pre-memory-munlock", + "pre-memory-mprotect", "pre-memory-mmap", "pre-memory-munmap", + "pre-memory-mremap", "pre-memory-shmget", "pre-memory-shmat", + + # Words that are not in the dictionary but are correct + "api", "apis", "args", "async", "asyncify", "atexit", "auth", "autodebug", + "autoloader", "big-endian", "bitcode", "bytecode", "c++", "c/c++", "c-style", + "callbacks", "ccall", "cflags", "char", "classpath", "cli", "cpu", "cwrap", + "debuggability", "demangle", "demangling", "dereferencing", "destructor", + "destructors", "dev", "devtools", "doxygen", "dts", "em++", "embind", + "emconfigure", "emmake", "emscripten-ports", "enum", "enums", "faq", "faqs", + "ffi", "filesystem", "fPIC", "gcc", "getter", "getters", "gl", "gles", + "gles2", "gles3", "gpu", "grep", "html", "http", "https", "https", "ide", + "idl", "iframe", "implementations", "import", "imports", "interop", "io", + "iostream", "ios", "js-style", "json", "le", "lerp", "libc", "libc++", + "libdl", "libgl", "libglut", "libhtml5", "libjs", "libm", "libstdc++", + "linux", "lto", "macos", "makefile", "malloc", "metadata", "minify", + "minified", "minifier", "mmap", "mmaped", "mmaping", "mmaps", "mono", + "multithreading", "musl", "nacl", "ndk", "noop", "npm", "opengl", + "optimisations", "os", "overriddable", "param", "params", "pixel", + "pixels", "pnacl", "pointer", "pointers", "polyfill", "polyfills", + "porting", "posix", "post-link", "post-optimization", "pre-compiled", + + # common technical terms + "backend", "backwards", "binder", "builds", "bytecode", "charset", + "config", "configs", "cross-compiling", "cross-platform", "deadlock", + "deadlocks", "deserialization", "deserializer", "deserializers", + "deserializing", "downcasting", "emitted", "endian", "endianness", + "frontend", "functionality", "getter", "getters", "hardcode", + "hardcoded", "hardcoding", "hardcodes", "header", "headers", + "heap", "hostname", "hotspot", "hotspots", "hyperlink", "hyperlinks", + "instantiate", "instantiated", "instantiates", "instantiating", + "instantiation", "interoperability", "intranet", "intranets", + "invoker", "invokers", "jitting", "jitted", "jit", "jits", "key-value", + "keyword", "keywords", "little-endian", "localhost", "long-lived", + "looping", "loop", "loops", "macro", "macros", "main-thread", + "megabytes", "metaprogramming", "multi-threaded", "multi-threading", + "multi-core", "multi-processor", "multi-user", "multicore", + "multiprocessor", "multiuser", "namespace", "namespaces", + "non-blocking", "non-member", "non-virtual", "offline", "online", + "opcode", "opcodes", "operand", "operands", "out-of-bounds", + "out-of-memory", "overridable", "overhead", "overheads", + "parameter", "parameters", "pathname", "pathnames", "performance", + "permalink", "permalinks", "per-pixel", "per-thread", "per-vertex", + "pipelining", "placeholder", "placeholders", "plaintext", + "platform-specific", "pre-allocated", "pre-computation", + "pre-computed", "pre-computing", "pre-compiling", "pre-existing", + "pre-generated", "pre-indexed", "pre-linking", "pre-loaded", + "pre-loading", "pre-optimization", "pre-optimized", "pre-optimizing", + "pre-parsing", "pre-processed", "pre-processing", "pre-rendering", + "pre-sorting", "pre-tokenized", "pre-tokenizing", "pre-warming", + "programmatic", "programmatically", "protocol", "protocols", + "prototypal", "prototyped", "prototypes", "prototyping", + "read-only", "re-allocate", "re-allocated", "re-allocating", + "re-allocation", "re-compilation", "re-compile", "re-compiled", + "re-compiling", "re-compiles", "re-create", "re-created", + "re-creates", "re-creating", "re-creation", "re-entrant", + "re-entrantly", "re-entrancy", "re-entrancy-safe", + "re-entrancy-unsafe", "re-entrant-safe", "re-entrant-unsafe", + "re-execution", "re-implement", "re-implemented", + "re-implementing", "re-implements", "re-implementation", + "re-implementations", "re-initialize", "re-initialized", + "re-initializes", "re-initializing", "re-initialization", + "re-link", "re-linked", "re-linking", "re-links", + "re-load", "re-loaded", "re-loading", "re-loads", + "re-mapping", "re-mapped", "re-maps", "re-map", + "re-minify", "re-minified", "re-minifies", "re-minifying", + "re-optimization", "re-optimize", "re-optimized", "re-optimizes", + "re-optimizing", "re-parse", "re-parsed", "re-parses", + "re-parsing", "re-run", "re-runs", "re-running", + "re-symbolify", "re-symbolified", "re-symbolifies", + "re-symbolifying", "re-target", "re-targeted", "re-targeting", + "re-targets", "re-throw", "re-thrown", "re-throwing", + "re-throws", "re-use", "re-used", "re-uses", + "re-using", "re-validation", "re-validate", "re-validated", + "re-validates", "re-validating", "read-write", "real-time", + "realtime", "recompilation", "recompile", "recompiled", + "recompiles", "recompiling", "refactor", "refactored", + "refactoring", "refactors", "refreshed", "refreshes", + "refreshes-per-second", "refreshes-per-second", "reloading", + "remap", "remaps", "remapped", "remapping", "reminification", + "reminify", "reminified", "reminifies", "reminifying", + "reoptimization", "reoptimize", "reoptimized", "reoptimizes", + "reoptimizing", "reparse", "reparsed", "reparses", + "reparsing", "rerun", "reruns", "rerunning", + "resymbolify", "resymbolified", "resymbolifies", "resymbolifying", + "retarget", "retargeted", "retargeting", "retargets", + "rethrow", "rethrows", "rethrown", "rethrowing", + "runtime", "runtimes", "sandboxed", "sandboxing", + "sandbox", "sandboxes", "screenshot", "screenshots", + "scripting", "server-side", "setter", "setters", + "single-core", "single-pass", "single-threaded", + "single-threading", "singleton", "singletons", + "snapshot", "snapshots", "snapshotting", + "source-level", "stack-based", "stack-like", + "stack-trace", "stack-traces", "stack-unwind", + "stack-unwinding", "standalone", "state-machine", + "state-machines", "sub-class", "sub-classed", + "sub-classes", "sub-classing", "sub-command", + "sub-commands", "sub-directory", "sub-directories", + "sub-graph", "sub-graphs", "sub-module", "sub-modules", + "sub-pixel", "sub-pixels", "sub-process", "sub-processes", + "sub-resource", "sub-resources", "sub-string", "sub-strings", + "sub-system", "sub-systems", "sub-task", "sub-tasks", + "sub-tree", "sub-trees", "sub-type", "sub-types", + "subclass", "subclassed", "subclasses", "subclassing", + "subcommand", "subcommands", "subdirectory", "subdirectories", + "subgraph", "subgraphs", "submodule", "submodules", + "subprocess", "subprocesses", "subresource", "subresources", + "substring", "substrings", "subsystem", "subsystems", + "subtree", "subtrees", "subtype", "subtypes", + "swap-in", "swap-ins", "swap-out", "swap-outs", + "swapping", "swaps", "symbol-map", "symbol-maps", + "sync-point", "sync-points", "synchronous", "synchronously", + "syntactic", "syntactically", "system-level", "system-wide", + "table-driven", "table-like", "telemetry", "thread-local", + "thread-safe", "thread-safety", "thread-unsafe", + "throughput", "tile-based", "time-out", "time-outs", + "timestamp", "timestamps", "top-level", "transcompilation", + "transcompile", "transcompiled", "transcompiles", "transcompiling", + "transliterate", "transliterated", "transliterates", + "transliterating", "transliteration", "tree-like", + "tuple-like", "type-safe", "type-safety", "type-unsafe", + "un-minify", "un-minified", "un-minifies", "un-minifying", + "un-optimized", "un-optimizing", "un-pack", "un-packed", + "un-packing", "un-packs", "un-register", "un-registered", + "un-registering", "un-registers", "un-sandboxed", + "un-sandboxing", "un-sandbox", "un-sandboxes", + "un-supported", "un-typed", "un-wrapped", "un-wrapping", + "un-wraps", "un-zip", "un-zipped", "un-zipping", + "un-zips", "unaligned", "unbuffered", "uncached", + "unclamped", "uncompressed", "unconditional", + "unconditionally", "undefined", "under-the-hood", + "unhandled", "uninitialized", "uninstrumented", + "uninstrumenting", "uninstrument", "uninstruments", + "uninstrumented", "uninterrupted", "uninterruptedly", + "uninterruptedness", "unmanaged", "unmarshaled", + "unmarshaling", "unmarshal", "unmarshals", "unmarshalled", + "unminified", "unminify", "unminifies", "unminifying", + "unmodified", "unoptimized", "unoptimizing", "unpack", + "unpacked", "unpacking", "unpacks", "unparsed", + "unreachable", "unregistered", "unregistering", + "unregisters", "unrestricted", "unsandboxed", + "unsandboxing", "unsandbox", "unsandboxes", + "unsigned", "unsupported", "unsuffixed", "untyped", + "unwrapped", "unwrapping", "unwraps", "unzip", + "unzipped", "unzipping", "unzips", "up-to-date", + "up-to-the-minute", "up-to-the-second", "up-to-date", + "up-to-date-ness", "up-to-dateness", "up-to-date-ness", + "up-to-dateness", "up-to-the-minute", "up-to-the-second", + "up-to-date", "up-to-date-ness", "up-to-dateness", + "up-to-date-ness", "up-to-dateness", "up-to-the-minute", + "up-to-the-second", "up-to-date", "up-to-date-ness", + "up-to-dateness", "up-to-date-ness", "up-to-dateness", + "up-to-the-minute", "up-to-the-second", "up-to-date", + "up-to-date-ness", "up-to-dateness", "up-to-date-ness", + "up-to-dateness", "up-to-the-minute", "up-to-the-second", + "up-to-date", "up-to-date-ness", "up-to-dateness", + "up-to-date-ness", "up-to-dateness", "up-to-the-minute", + "up-to-the-second", "up-to-date", "up-to-date-ness", + "up-to-dateness", "up-to-date-ness", "up-to-dateness", + "up-to-the-minute", "up-to-the-second", "up-to-date", + "up-to-date-ness", "up-to-dateness", "up-to-date-ness", + "up-to-dateness", "up-to-the-minute", "up-to-the-second", + "up-to-date", "up-to-date-ness", "up-to-dateness", + "up-to-date-ness", "up-to-dateness", "up-to-the-minute", + "up-to-the-second", "up-to-date", "up-to-date-ness", + "up-to-dateness", "up-to-date-ness", "up-to-dateness", + "up-to-the-minute", "up-to-the-second", "up-to-date", + "up-to-date-ness", "up-to-dateness", "up-to-date-ness", + "up-to-dateness", "up-to-the-minute", "up-to-the-second", + "up-to-date", "up-to-date-ness", "up-to-dateness", + "up-to-date-ness", "up-to-dateness", "up-to-the-minute", + "up-to-the-second", "up-to-date", "up-to-date-ness", + "up-to-dateness", "up-to-date-ness", "up-to-dateness", + "up-to-the-minute", "up-to-the-second", "up-to-date", + "up-to-date-ness", "up-to-dateness", "up-to-date-ness", + "up-to-dateness", "up-to-the-minute", "up-to-the-second", + "up-to-date", "up-to-date-ness", "up-to-dateness", + "up-to-date-ness", "up-to-dateness", "up-to-the-minute", + "up-to-the-second", "up-to-date", "up-to-date-ness", + "up-to-dateness", "up-to-date-ness", "up-to-dateness", + "up-to-the-minute", "up-to-the-second", "up-to-date", + "up-to-date-ness", "up-to-dateness", "up-to-date-ness", + "up-to-dateness", "up-to-the-minute", "up-to-the-second", + "up-to-date", "up-to-date-ness", "up-to-dateness", + "up-to-date-ness", "up-to-dateness", "up-to-the-minute", + "up-to-the-second", + "mulithreaded", "idential", "offscreenvancas", "parralel" +} + +def spell_check_file(filepath): + d = enchant.Dict("en_US") + with open(filepath, 'r') as f: + content = f.read() + + # Remove code blocks + content = re.sub(r'.. code-block::.*?\n\n(.*?)\n\n', '', content, flags=re.DOTALL) + + # Simple word tokenization (can be improved) + words = re.findall(r'\b[a-zA-Z]+\b', content) + + misspelled = [] + for word in words: + if word.lower() not in EXCLUDED_WORDS and not d.check(word): + misspelled.append(word) + + return misspelled + +if __name__ == "__main__": + errors = spell_check_file('site/source/docs/site/glossary.rst') + if errors: + print("Misspelled words found:") + for error in errors: + print(error) + else: + print("No misspelled words found.") diff --git a/spell_check.sh b/spell_check.sh new file mode 100755 index 0000000000000..4e6ad17a94504 --- /dev/null +++ b/spell_check.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +# List of common misspellings +misspellings=( + "definately" + "seperate" + "occured" + "recieve" + "untill" + "wich" + "acheive" + "succesful" + "arguement" + "completly" + "enviornment" + "goverment" + "independant" + "knowlege" + "neccessary" + "paralel" + "peice" + "personel" + "publically" + "reccomend" + "refered", + "suprise", + "wierd", + "unforseen", + "definately", + "seperate", + "occured", + "recieve", + "untill", + "wich", + "acheive", + "succesful", + "arguement", + "completly", + "enviornment", + "goverment", + "independant", + "knowlege", + "neccessary", + "paralel", + "peice", + "personel", + "publically", + "reccomend", + "refered", + "wierd", + "unforseen", + "adress", + "accomodate", + "acknowledgment", + "appearence", + "beleive", + "calender", + "cemetary", + "collegue", + "commitee", + "concious", + "curiousity", + "definate", + "dilemna", + "embarass", + "existance", + "firey", + "foriegn", + "freind", + "futher", + "garantee", + "grammer", + "harrass", + "heirarchy", + "humourous", + " imediately", + "incidently", + "interupt", + "irresistable", + "jewlery", + "judgement", + "leisure", + "liason", + "maintainance", + "mischevious", + "misspell", + "noticable", + "occasionaly", + "occurence", + "ommision", + "pasionate", + "pasttime", + "pavillion", + "percieve", + "posession", + "potatos", + "priviledge", + "pronounciation", + "questionaire", + "rythm", + "seige", + "seize", + "seperable", + "sincerly", + "succede", + "sucess", + "tatoo", + "tendancy", + "threshhold", + "tommorrow", + "tounge", + "truely", + "unecesary", + "untill", + "vacume", + "visious", + "wether" +) + +# Find all .rst files +files=$(find site/source/docs -name "*.rst") + +# Check for misspellings +for file in $files; do + for word in "${misspellings[@]}"; do + grep -i -n "$word" "$file" + done +done