hunspell-reader
A library for reading Hunspell Dictionary Files
Last updated 4 years ago by jason-dent .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hunspell-reader 
SYNC missed versions from official npm registry.

hunspell-reader

Build Status

A library for reading Hunspell Dictionary files

Application

This reader can be used as a tool for converting Hunspell files into a simple text file with one word per line.

Installation

npm install -g hunspell-reader

Usage

It has basic command line help.

hunspell-reader words --help

Outputs:


  Usage: words [options] <hunspell_dic_file>

  Output all the words in the <hunspell.dic> file.

  Options:

    -h, --help           output usage information
    -o, --output <file>  output file - defaults to stdout
    -s, --sort           sort the list of words
    -u, --unique         make sure the words are unique.
    -i, --ignore_case    used with --unique and --sort
    -l, --lower_case     output in lower case
    -T, --no-transform   Do not apply the prefix and suffix transforms.  Root words only.

Converting Hunspell to word list

To convert a Hunspell dictionary to a word list, you will need both the .dic and .aff files. For example en_US comes with two files: en_US.dic and en_US.aff. This tool assumes they are both in the same directory.

Assuming these files are in the current directory, the following command will write the words to en_US.txt.

hunspell-reader words ./en_US.dic -o en_US.txt

Library Functions

Installation

install -S hunspell-reader rxjs

Note: the reader uses rxjs 5.0.

Usage

Typescript / Javascript:

import { HunspellReader } from 'hunspell-reader';

const baseFile = 'en_US';
const dicFile = baseFile + '.dic';
const affFile = baseFile + '.aff';

// Initialize the reader with the Hunspell files
const reader = new HunspellReader(affFile, dicFile);

// Get the words as an array
const promiseArrayOfWords = reader.readWords().toArray().toPromise();

Reference

Current Tags

  • 5.17.0                                ...           latest (4 years ago)
  • 5.17.0-alpha.0                                ...           next (4 years ago)

54 Versions

  • 5.17.0                                ...           4 years ago
  • 5.17.0-alpha.0                                ...           4 years ago
  • 5.16.0                                ...           4 years ago
  • 5.15.3                                ...           4 years ago
  • 5.15.2                                ...           4 years ago
  • 5.15.1                                ...           4 years ago
  • 5.15.0                                ...           4 years ago
  • 5.14.0                                ...           4 years ago
  • 5.14.0-alpha.0                                ...           4 years ago
  • 5.13.4                                ...           4 years ago
  • 5.13.3                                ...           4 years ago
  • 5.13.2                                ...           4 years ago
  • 5.13.1                                ...           4 years ago
  • 5.13.0                                ...           4 years ago
  • 5.12.6                                ...           4 years ago
  • 5.12.5                                ...           4 years ago
  • 5.12.4                                ...           4 years ago
  • 5.12.3                                ...           5 years ago
  • 5.12.2                                ...           5 years ago
  • 5.12.0                                ...           5 years ago
  • 5.12.0-alpha.0                                ...           5 years ago
  • 5.11.1                                ...           5 years ago
  • 5.11.0                                ...           5 years ago
  • 5.11.0-alpha.0                                ...           5 years ago
  • 5.10.0                                ...           5 years ago
  • 5.10.0-alpha.6                                ...           5 years ago
  • 5.10.0-alpha.3                                ...           5 years ago
  • 5.10.0-alpha.2                                ...           5 years ago
  • 5.9.1                                ...           5 years ago
  • 5.9.1-alpha.1                                ...           5 years ago
  • 5.9.0                                ...           5 years ago
  • 5.9.0-alpha.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.2.0                                ...           6 years ago
  • 3.1.5                                ...           6 years ago
  • 3.1.4                                ...           6 years ago
  • 3.1.3                                ...           6 years ago
  • 3.1.2                                ...           6 years ago
  • 3.1.1                                ...           6 years ago
  • 3.0.1                                ...           7 years ago
  • 2.1.2                                ...           7 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.4                                ...           8 years ago
  • 2.0.3                                ...           8 years ago
  • 2.0.2                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 1.2.1                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 30
Dependencies (4)
Dev Dependencies (7)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |