words-and-hyphens

Extracts unique words and hyphens from text stripping punctuation on the way.

Usage no npm install needed!

<script type="module">
  import wordsAndHyphens from 'https://cdn.skypack.dev/words-and-hyphens';
</script>

README

words-and-hyphens

Extracts unique words and hyphens from text stripping punctuation on the way.

Build Status Coverage Status Dependency Status

NPM

Installation

In your project path:

npm install words-and-hyphens --save

Usage

var pattern = require('hyphenation.de'); // for more information visit https://github.com/bramstein/hypher
var extractor = require('words-and-hyphens')(pattern);

extractor.uniqueWords('My, st[ring] *full* of %punct) "and\' of the same Same same words.');
// -> ['and', 'full', 'My', 'of', 'punct', 'same', 'string', 'the', 'words']

extractor.uniqueWords('My, st[ring] *full* of %punct) "and\' of the same Same same words.', true);
// -> ['and', 'full', 'My', 'of', 'punct', 'Same', 'same', 'string', 'the', 'words']

extractor.uniqueHyphens('Fischers\' Fritz fischt frische Fische.');
// -> ['fi', 'fischt', 'fri', 'fritz', 'sche', 'schers'];

Contributing

Issues and Pull-requests are absolutely welcome. If you want to submit a patch, please make sure that you follow this simple rule:

All code in any code-base should look like a single person typed it, no matter how. many people contributed. — idiomatic.js

Lint with:

npm run jshint

Test with:

npm run mocha

Check code coverage with:

npm run istanbul

Then please commit with a detailed commit message.