{"id":21019348,"url":"https://github.com/rmraya/mxspell","last_synced_at":"2026-04-27T19:31:48.109Z","repository":{"id":133853759,"uuid":"497082154","full_name":"rmraya/MXSpell","owner":"rmraya","description":"Spellchecker that uses Hunspell dictionaries","archived":false,"fork":false,"pushed_at":"2023-09-03T17:32:24.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T12:45:08.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmraya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-27T17:27:07.000Z","updated_at":"2022-08-31T13:40:44.000Z","dependencies_parsed_at":"2024-11-19T10:36:08.617Z","dependency_job_id":"dcff53e7-6365-47dc-8e79-3637a6eae2b9","html_url":"https://github.com/rmraya/MXSpell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FMXSpell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FMXSpell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FMXSpell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FMXSpell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmraya","download_url":"https://codeload.github.com/rmraya/MXSpell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243447641,"owners_count":20292455,"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":[],"created_at":"2024-11-19T10:31:22.663Z","updated_at":"2025-12-25T19:56:18.334Z","avatar_url":"https://github.com/rmraya.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MXSpell\n\nJava spellchecker library using Hunspell dictionaries. Requires Java 21+. No external dependencies.\n\n## Core Classes\n\n### SpellChecker\n\nMain entry point for spellchecking operations.\n\n**Constructor:**\n\n```java\nSpellChecker(String language, String dictionaryFolder) throws IOException\n```\n\n- `language`: BCP47 language code (e.g., \"en-US\", \"de-DE\", \"fr\"). Internally converted to match dictionary file names with underscores.\n- `dictionaryFolder`: Path to directory containing dictionaries\n\nThe constructor looks for dictionaries in two formats:\n\n1. Subdirectory named after the language containing `.aff` and `.dic` files\n2. ZIP file named `{language}.zip` containing the dictionary files\n\n**Methods:**\n\n```java\nString[] suggest(String word)\n```\n\nReturns spelling suggestions for a word. Empty array if word is correct.\n\n```java\nvoid learn(String word)\n```\n\nAdds a word to the learned words list (persists across sessions).\n\n```java\nvoid ignore(String word)\n```\n\nIgnores a word for the current session only.\n\n```java\nMap\u003cString, String[]\u003e checkString(String text)\n```\n\nChecks all words in a text string. Returns map of misspelled words to their suggestions.\n\n```java\nDictionary getDictionary()\n```\n\nReturns the underlying Dictionary object for advanced operations.\n\n### Dictionary\n\nManages word lookup and validation. Obtained via `SpellChecker.getDictionary()`.\n\n**Key Methods:**\n\n```java\nDictionaryEntry lookup(String word)\n```\n\nLooks up a word in the dictionary. Returns `null` if not found.\n\n```java\nList\u003cString\u003e getWords(DictionaryEntry entry) throws IOException\n```\n\nReturns all word forms generated from a dictionary entry by applying affix rules.\n\n```java\nboolean isValidCompound(String word)\n```\n\nChecks if a word is valid as a compound word based on compound flags.\n\n```java\nvoid learn(String word)\nvoid ignore(String word)\nSet\u003cString\u003e getLearnedWords()\nSet\u003cString\u003e getIgnoredWords()\n```\n\nManage learned and ignored words.\n\n### DictionaryEntry\n\nRepresents a word entry from the dictionary.\n\n**Constructor:**\n\n```java\nDictionaryEntry(String word, String flags, String morphology)\n```\n\n**Methods:**\n\n```java\nString getWord()\nString getFlags()\nString getMorphology()\n```\n\n## Basic Usage\n\n```java\nimport com.maxprograms.mxspell.SpellChecker;\n\n// Initialize with US English dictionary\nSpellChecker checker = new SpellChecker(\"en-US\", \"path/to/dictionaries\");\n\n// Check a word\nString[] suggestions = checker.suggest(\"speling\");\nif (suggestions.length \u003e 0) {\n    System.out.println(\"Did you mean: \" + String.join(\", \", suggestions));\n}\n\n// Check multiple words\nMap\u003cString, String[]\u003e results = checker.checkString(\"The speling is rong\");\nfor (Map.Entry\u003cString, String[]\u003e entry : results.entrySet()) {\n    System.out.println(entry.getKey() + \" -\u003e \" + String.join(\", \", entry.getValue()));\n}\n\n// Learn a word\nchecker.learn(\"customword\");\n\n// Ignore a word for this session\nchecker.ignore(\"propertyname\");\n```\n\n## Supported Features\n\n- Affix rules (prefixes and suffixes)\n- Cross-product affix application (prefix+suffix combinations)\n- Compound word validation with full flag support\n- Replacement tables (REP directive)\n- TRY characters for suggestion generation\n- FORBIDDENWORD flag (rejects forbidden words)\n- NOSUGGEST flag (excludes words from suggestions)\n- KEEPCASE flag (enforces exact case matching)\n- Encoding detection (UTF-8, ASCII, ISO-8859-*, Windows codepages)\n- Thread-safe operations\n- Learned and ignored words\n\n## Dictionary Format\n\nRequires Hunspell-compatible dictionaries:\n\n- `.aff` file: Affix rules and configuration\n- `.dic` file: Word list with flags\n\nDictionary structure:\n\n```\ndictionaryFolder/\n  language/\n    index.aff\n    index.dic\n```\n\nOr as ZIP files:\n\n```\ndictionaryFolder/\n  language.zip (containing .aff and .dic)\n```\n\n## Building\n\n```bash\ngradle clean build\n```\n\nOutput: `lib/mxspell.jar`\n\n## Thread Safety\n\nAll classes are thread-safe. Dictionary and AffixParser use immutable collections after initialization. SpellChecker can be safely shared across threads.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmraya%2Fmxspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmraya%2Fmxspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmraya%2Fmxspell/lists"}