{"id":13423669,"url":"https://github.com/nuspell/nuspell","last_synced_at":"2026-01-12T06:54:52.730Z","repository":{"id":40582540,"uuid":"111691218","full_name":"nuspell/nuspell","owner":"nuspell","description":"🖋️ Fast and safe spellchecking C++ library","archived":false,"fork":false,"pushed_at":"2024-08-14T17:39:55.000Z","size":8126,"stargazers_count":229,"open_issues_count":25,"forks_count":25,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-26T23:12:04.123Z","etag":null,"topics":["natural-language-processing","spellcheck","spellchecker","spellchecking","spelling-checker","spelling-corrector"],"latest_commit_sha":null,"homepage":"https://nuspell.github.io","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuspell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-22T14:00:02.000Z","updated_at":"2024-10-13T15:14:32.000Z","dependencies_parsed_at":"2024-08-07T15:48:08.290Z","dependency_job_id":"f71202e3-4628-42db-bca2-bde1a2b61e64","html_url":"https://github.com/nuspell/nuspell","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuspell%2Fnuspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuspell%2Fnuspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuspell%2Fnuspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuspell%2Fnuspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuspell","download_url":"https://codeload.github.com/nuspell/nuspell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243767120,"owners_count":20344873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["natural-language-processing","spellcheck","spellchecker","spellchecking","spelling-checker","spelling-corrector"],"created_at":"2024-07-31T00:00:40.252Z","updated_at":"2026-01-12T06:54:52.721Z","avatar_url":"https://github.com/nuspell.png","language":"C++","readme":"# About Nuspell\n\nNuspell is a fast and safe spelling checker software program. It is designed\nfor languages with rich morphology and complex word compounding.\nNuspell is written in modern C++ and it supports Hunspell dictionaries.\n\nMain features of Nuspell spelling checker:\n\n  - Provides software library and command-line tool.\n  - Suggests high-quality spelling corrections.\n  - Backward compatibility with Hunspell dictionary file format.\n  - Up to 3.5 times faster than Hunspell.\n  - Full Unicode support backed by ICU.\n  - Twofold affix stripping (for agglutinative languages, like Azeri,\n    Basque, Estonian, Finnish, Hungarian, Turkish, etc.).\n  - Supports complex compounds (for example, Hungarian, German and Dutch).\n  - Supports advanced features, for example: special casing rules\n    (Turkish dotted i or German sharp s), conditional affixes, circumfixes,\n    fogemorphemes, forbidden words, pseudoroots and homonyms.\n  - Free and open source software. Licensed under GNU LGPL v3 or later.\n\n# Building Nuspell\n\n## Dependencies\n\nBuild-only dependencies:\n\n  - C++ 17 compiler with support for `std::filesystem`, e.g. GCC \u003e= v9\n  - CMake \u003e= v3.18\n  - Catch2 \u003e= v3.1.1 (optional, needed only when building the tests is enabled)\n  - Getopt (Needed only on Windows + MSVC and only when the CLI tool or\n    the tests are built. It is available in Vcpkg. Other platforms provide\n    it out of the box.)\n  - Pandoc (optional, needed only when building the man-pages is enabled)\n  - Doxygen (optional, needed only when building the API docs is enabled)\n\nRun-time (and build-time) dependencies:\n\n  - ICU4C\n\nRecommended tools for developers: qtcreator, ninja, clang-format, gdb, vim.\n\n## Building on GNU/Linux and Unixes\n\nWe first need to download the dependencies. Some may already be\npreinstalled.\n\nFor Ubuntu and Debian:\n\n```bash\nsudo apt install g++ cmake libicu-dev catch2 pandoc doxygen\n```\n\nThen run the following commands inside the Nuspell directory:\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\nsudo make install\nsudo ldconfig       # needed only sometimes and only on Linux\n```\n\n\nFor faster build process run `make -j`, or use Ninja instead\nof Make.\n\nIf you are making a Linux distribution package (dep, rpm) you need\nsome additional configurations on the CMake invocation. For example:\n\n```bash\ncmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr\n```\n\n## Building on OSX and macOS\n\n1.  Install Apple's Command-line tools.\n2.  Install Homebrew package manager.\n3.  Install dependencies with the next commands.\n\n\u003c!-- end list --\u003e\n\n```bash\nbrew install cmake icu4c catch2 pandoc doxygen\nexport ICU_ROOT=$(brew --prefix icu4c)\n```\n\nThen run the standard cmake and make. See above. The ICU\\_ROOT variable\nis needed because icu4c is keg-only package in Homebrew and CMake can\nnot find it by default. Alternatively, you can use `-DICU_ROOT=...` on\nthe cmake command line.\n\nIf you want to build with GCC instead of Clang, you need to pull GCC\nwith Homebrew and rebuild all the dependencies with it. See Homewbrew\nmanuals.\n\n## Building on Windows\n\n### Compiling with Visual C++\n\n1.  Install Visual Studio 2017 or newer. Alternatively, you can use\n    Visual Studio Build Tools.\n2.  Install Git for Windows and Cmake.\n3.  Install Vcpkg in some folder, e.g. in `c:\\vcpkg`.\n4.  Install Pandoc. You can manually install or use `choco install pandoc`.\n4.  Install Doxygen. You can manually install or use\n    `choco install doxygen.install`.\n5.  Run the commands below. Vcpkg will work in manifest mode and it will\n    automatically install the dependencies.\n\n\u003c!-- end list --\u003e\n\n```bat\nmkdir build\ncd build\ncmake .. -DCMAKE_TOOLCHAIN_FILE=c:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake -A x64\ncmake --build .\n```\n\n### Compiling with Mingw64 and MSYS2\n\nDownload MSYS2, update everything and install the following packages:\n\n```bash\npacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-icu \\\n          mingw-w64-x86_64-cmake mingw-w64-x86_64-catch mingw-w64-x86_64-doxygen\n```\n\nThen from inside the Nuspell folder run:\n\n```bash\nmkdir build\ncd build\ncmake .. -G \"Unix Makefiles\" -DBUILD_MAN=OFF\nmake\nmake install\n```\n\n### Building in Cygwin environment\n\nDownload the above mentioned dependencies with Cygwin package manager.\nThen compile the same way as on Linux. Cygwin builds depend on\nCygwin1.dll.\n\n## Building on FreeBSD\n\nInstall the following required packages\n\n```bash\npkg cmake icu catch2 pandoc doxygen\n```\n\nThen run the standard cmake and make as on Linux. See above.\n\n# Using the software\n\n## Using the command-line tool\n\nThe main executable is located in `src/nuspell`.\n\nAfter compiling and installing you can run the Nuspell spell checker\nwith a Nuspell, Hunspell or Myspell dictionary:\n\n    nuspell -d en_US text.txt\n\nFor more details run see the [man-page](docs/nuspell.1.md).\n\n\u003c!-- old hunspell v1 stuff\nThe src/tools directory contains ten executables after compiling.\n\n  - The main executable:\n      - nuspell: main program for spell checking and others (see manual)\n  - Example tools:\n      - analyze: example of spell checking, stemming and morphological\n        analysis\n      - chmorph: example of automatic morphological generation and\n        conversion\n      - example: example of spell checking and suggestion\n  - Tools for dictionary development:\n      - affixcompress: dictionary generation from large (millions of\n        words) vocabularies\n      - makealias: alias compression (Nuspell only, not back compatible\n        with MySpell)\n      - wordforms: word generation (Nuspell version of unmunch)\n      - ~~hunzip: decompressor of hzip format~~ (DEPRECATED)\n      - ~~hzip: compressor of hzip format~~ (DEPRECATED)\n      - munch (DEPRECATED, use affixcompress): dictionary generation\n        from vocabularies (it needs an affix file, too).\n      - unmunch (DEPRECATED, use wordforms): list all recognized words\n        of a MySpell dictionary\n--\u003e\n\n## Using the Library\n\nSample program:\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003cnuspell/dictionary.hxx\u003e\n#include \u003cnuspell/finder.hxx\u003e\n\nusing namespace std;\n\nint main()\n{\n\tauto dirs = vector\u003cfilesystem::path\u003e();\n\tnuspell::append_default_dir_paths(dirs);\n\tauto dict_path = nuspell::search_dirs_for_one_dict(dirs, \"en_US\");\n\tif (empty(dict_path))\n\t\treturn 1; // Return error because we can not find the requested\n\t\t          // dictionary.\n\n\tauto dict = nuspell::Dictionary();\n\ttry {\n\t\tdict.load_aff_dic(dict_path);\n\t}\n\tcatch (const nuspell::Dictionary_Loading_Error\u0026 e) {\n\t\tcerr \u003c\u003c e.what() \u003c\u003c '\\n';\n\t\treturn 1;\n\t}\n\tauto word = string();\n\tauto sugs = vector\u003cstring\u003e();\n\twhile (cin \u003e\u003e word) {\n\t\tif (dict.spell(word)) {\n\t\t\tcout \u003c\u003c \"Word \\\"\" \u003c\u003c word \u003c\u003c \"\\\" is ok.\\n\";\n\t\t\tcontinue;\n\t\t}\n\n\t\tcout \u003c\u003c \"Word \\\"\" \u003c\u003c word \u003c\u003c \"\\\" is incorrect.\\n\";\n\t\tdict.suggest(word, sugs);\n\t\tif (sugs.empty())\n\t\t\tcontinue;\n\t\tcout \u003c\u003c \"  Suggestions are: \";\n\t\tfor (auto\u0026 sug : sugs)\n\t\t\tcout \u003c\u003c sug \u003c\u003c ' ';\n\t\tcout \u003c\u003c '\\n';\n\t}\n}\n```\n\nOn the command line you can link like this:\n\n```bash\ng++ example.cxx -std=c++17 -lnuspell -licuuc -licudata\n# or better, use pkg-config\ng++ example.cxx -std=c++17 $(pkg-config --cflags --libs nuspell)\n```\n\nWithin Cmake you can use `find_package()` to link. For example:\n\n```cmake\nfind_package(Nuspell)\nadd_executable(myprogram main.cpp)\ntarget_link_libraries(myprogram Nuspell::nuspell)\n```\n\n# Dictionaries\n\nMyspell, Hunspell and Nuspell dictionaries:\n\n\u003chttps://github.com/nuspell/nuspell/wiki/Dictionaries-and-Contacts\u003e\n\n\n# Advanced topics\n## Debugging Nuspell\n\nFirst, always install the debugger:\n\n```bash\nsudo apt install gdb\n```\n\nFor debugging we need to create a debug build and then we need to start\n`gdb`.\n\n```bash\nmkdir debug\ncd debug\ncmake .. -DCMAKE_BUILD_TYPE=Debug\nmake -j\ngdb src/nuspell/nuspell\n```\n\nWe recommend debugging to be done\n[with an IDE](https://github.com/nuspell/nuspell/wiki/IDE-Setup).\n\n## Testing\n\nTo run the tests, run the following command after building:\n\n    ctest\n\n# See also\n\nFull documentation in the [wiki](https://github.com/nuspell/nuspell/wiki).\n\nAPI Documentation for developers will be generated from the source files\nby configuring CMake with `-DBUILD_API_DOCS=ON` (ON by default) and building.\n\nThe result can be viewed by opening `BUILD_DIR/docs/html/index.html` during\ndevelopment, or by opening `INSTALL_PREFIX/share/doc/nuspell/html/index.html`\nafter installing.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuspell%2Fnuspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuspell%2Fnuspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuspell%2Fnuspell/lists"}