33 lines
9.2 KiB
JSON
33 lines
9.2 KiB
JSON
|
{
|
||
|
"name": "nodehun",
|
||
|
"version": "0.0.5",
|
||
|
"description": "The Hunspell binding for nodejs that exposes as much of hunspell as possible and also adds new features.",
|
||
|
"main": "lib/index.js",
|
||
|
"directories": {
|
||
|
"test": "tests"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||
|
},
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "https://github.com/nathanjsweet/nodehun.git"
|
||
|
},
|
||
|
"keywords": [
|
||
|
"spellcheck",
|
||
|
"spell",
|
||
|
"hunspell"
|
||
|
],
|
||
|
"author": {
|
||
|
"name": "Nathan Sweet"
|
||
|
},
|
||
|
"license": "MIT",
|
||
|
"readme": "Nodehun\n=======\n\nInstallation\n------------\nNodehun has no \"node_module\" dependencies (yet), so it can either be installed via npm or simply checked out of git. You'll need [node-gyp](https://github.com/TooTallNate/node-gyp) to build. Nodehun should work on Windows or Unix. You'll also need to make sure that libuv source\ncode is on your system. Usually having node installed is enough, but there are weird cases.\n\t\n\tnpm install nodehun\n\tcd src\n\tnode-gyp configure\n\tnode-gyp build\n\t\n\nIntroduction\n------------\nYes there are already two nodejs spell checkers based of off hunspell, but one doesn't seem to even be supported anymore, and the other seems to only support simple spelling suggestions. Nodehun aims to expose as much of hunspell's functionality as possible in an easy to understand and maintain way, while also offering additional functionality not even present in hunspell.\n\nSpell Suggest and Initialization, directory based\n-------------------------------------------------\nInitializing nodehun is very easy, it will automatically find the dictionary you are looking for as long as it is inside the dictionaries folder (nodehun ships with US english and Canadian English, but tons of languages are available for free at [open office](http://extensions.services.openoffice.org/dictionary), you should be able to just drop any of open office's dictionary folders into nodehun's dictionary folder and it should automatically work, see the readme file in the dictionaries folder for more directions). From initialization there are only a few built in objects that come with nodehun, most of the functionality you will use are methods in the built in object \"Dictionary\". Simple spell suggest is very easy.\n\t \n\tvar nodehun = require('nodehun'),\n\t USDictionary = new nodehun.Dictionary('en_US');\n\t\t\n\tUSDictionary.spellSuggest('color',function(a,b){\n\t\tconsole.log(a,b);\n\t\t// because \"color\" is a defined word in the US English dictionary\n\t\t// the output will be: true, null\n\t});\n\t\n\tUSDictionary.spellSuggest('calor',function(a,b){\n\t\tconsole.log(a,b);\n\t\t// because \"calor\" is not a defined word in the US English dictionary\n\t\t// the output will be: false, \"carol\"\n\t});\n\t\nSpell Suggest and Initialization, buffer based.\n-------------------------------------------------\nAnother option for initializing a nodehun dictionary is to pass the raw string output of both the affix and dictionary files of a particular language. This allows you to use an alternate data-store than the servers file system. Please do not actually use `readFileSync`.\n\t \n\tvar nodehun = require('nodehun'),\n\t fs = require('fs'),\n\t USDictionary = new nodehun.Dictionary(fs.readFileSync('./en_US.aff').toString(),fs.readFileSync('./en_US.dic').toString());\n\t\t\n\tUSDictionary.spellSuggest('color',function(a,b){\n\t\tconsole.log(a,b);\n\t\t// because \"color\" is a defined word in the US English dictionary\n\t\t// the output will be: true, null\n\t});\n\t\n\tUSDictionary.spellSuggest('calor',function(a,b){\n\t\tconsole.log(a,b);\n\t\t// because \"calor\" is not a defined word in the US English dictionary\n\t\t// the output will be: false, \"carol\"\n\t});\n\t\nSpell Suggestions\n-----------------\nNodehun also offers a method that returns an array of words that could possibly match a misspelled word, ordered by most likely to be correct.\n\t\n\tvar nodehun = require('nodehun'),\n\t\tUSDictionary = new nodehun.Dictionary('en_US');\n\t\n\tUSDictionary.spellSuggestions('color',function(a,b){\n\t\tconsole.log(a,b);\n\t\t// because \"color\" is a defined word in the US English dictionary\n\t\t// the output will be: true, []\n\t});\n\n\tUSDictionary.spellSuggest('calor',function(a,b){\n\t\tconsole.log(a,b);\n\t\t// because \"calor\" is not a defined word in the US English dictionary\n\t\t// the output will be: false, [ 'carol','valor','color','cal or','cal-or','caloric','calorie']\n\t});\n\t\nAdd Dictionary\n--------------\nNodehun also can add another dictionary on top of an existing
|
||
|
"readmeFilename": "readme.md",
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/nathanjsweet/nodehun/issues"
|
||
|
},
|
||
|
"_id": "nodehun@0.0.5",
|
||
|
"_from": "nodehun@"
|
||
|
}
|