{"id":13740803,"url":"https://github.com/divvun/hfst-ospell-js","last_synced_at":"2025-05-08T20:32:40.714Z","repository":{"id":73184942,"uuid":"67423410","full_name":"divvun/hfst-ospell-js","owner":"divvun","description":"Node bindings for hfst-ospell","archived":true,"fork":false,"pushed_at":"2016-11-08T08:24:13.000Z","size":30,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-15T10:43:05.611Z","etag":null,"topics":["hfst-ospell","javascript","minority-language","natural-language"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/divvun.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-05T13:29:14.000Z","updated_at":"2023-01-28T14:22:05.000Z","dependencies_parsed_at":"2024-01-07T18:10:36.940Z","dependency_job_id":null,"html_url":"https://github.com/divvun/hfst-ospell-js","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/divvun%2Fhfst-ospell-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fhfst-ospell-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fhfst-ospell-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fhfst-ospell-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divvun","download_url":"https://codeload.github.com/divvun/hfst-ospell-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253145072,"owners_count":21861184,"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":["hfst-ospell","javascript","minority-language","natural-language"],"created_at":"2024-08-03T04:00:52.370Z","updated_at":"2025-05-08T20:32:40.389Z","avatar_url":"https://github.com/divvun.png","language":"C++","funding_links":[],"categories":["Software"],"sub_categories":["Utilities"],"readme":"# Node bindings for hfst-ospell\n\nThis is a simple work-in-progress library which aims to offer spell checking using [Hfst-ospell](https://github.com/hfst/hfst-ospell) in node.js.\n\n[![Build Status](https://travis-ci.org/divvun/hfst-ospell-js.svg?branch=master)](https://travis-ci.org/divvun/hfst-ospell-js)\n\n## Note on dictionary files\n\nYou can find several dictionaries on [divvun.no](http://www.divvun.no/korrektur/otherapps.html). Many are under the GPL, for some there is no license specified, though.\n\nAssuming you accept the license terms, you can e.g. use\n\n```sh\n$ mkdir etc\n$ curl http://divvun.no/static_files/zhfsts/se.zhfst \u003e etc/se.zhfst\n```\n\nto download the dictionary for North Sámi.\n\n## Install\n\nTo install this module, you first need to make sure you have\n\n- a C++ compiler,\n- Python (for node-gyp),\n- and `libarchive` (using e.g. `apt-get install libarchive-dev` or `brew install libarchive \u0026\u0026 brew link libarchive --force`)\n\ninstalled.\n\nYou can then use `npm install divvun/hfst-ospell-js` to install the node module directly from GitHub (it is not yet published to npm).\n\n**Note:** NPM versions older than 3.7.0 do not resolve git submodules when installing, so you may need to clone this repository manually and use `npm install` with a local path.\n\n## Usage\n\nThe API is pretty simple:\n\n```js\nvar hfstospell = require(\"hfst-ospell-js\");\nvar path_to_dictionary = \"etc/se.zhfst\";\nvar spellchecker = new hfstospell.SpellChecker(path_to_dictionary);\n\n// .suggestions(string) returns a Promise\nspellchecker.suggestions(\"akkusativa\")\n.then((suggestions) =\u003e console.log(suggestions))\n.catch((error) =\u003e console.error(suggestions));\n// =\u003e ['akkusatiivva', 'akkusatiiva', 'akkusatiivan']\n\n// But you can also use it with a callback\nspellchecker.suggestions(\"akkusativa\", (error, suggestions) =\u003e\n  console.log(error, suggestions));\n// =\u003e null, ['akkusatiivva', 'akkusatiiva', 'akkusatiivan']\n```\n\n## Development\n\nAfter you cloned this repository, make sure to also fetch the hfst-ospell sources using `git submodule update --init --recursive`.\n\nYou can build the library using `node-gyp configure build`. (Feel free to ignore any warnings on `lib/*` files.)\n\nUse `npm test` to verify the library works on the node side. Please note that this requires a dictionary file and tries to read `etc/se.zhfst` by default.\n\n## TODO\n\n- [x] Make it compile!\n- [x] Async with a small JS wrapper for Promise support\n- [ ] Investigate thread safety of hfst-ospell (we are currently using Mutexes to only ever search for one suggestion at a time)\n- [x] Use a constructor for the wrapped C++ object so we can re-use the loaded spell checker\n- [ ] Everything with TODO and FIXME in code!\n- [x] Compile tinyxml2 ourselves (it's just one file)\n- [ ] Compile libarchive ourselves (it's a truckload of stuff)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivvun%2Fhfst-ospell-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivvun%2Fhfst-ospell-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivvun%2Fhfst-ospell-js/lists"}