Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandonhimpfen/is-stop-words
is-stop-words is a lightweight npm package that allows you to check whether a word is a stop word or not.
https://github.com/brandonhimpfen/is-stop-words
stop stop-word stop-words word words
Last synced: 24 days ago
JSON representation
is-stop-words is a lightweight npm package that allows you to check whether a word is a stop word or not.
- Host: GitHub
- URL: https://github.com/brandonhimpfen/is-stop-words
- Owner: brandonhimpfen
- License: mit
- Created: 2023-06-19T22:49:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-19T23:09:25.000Z (over 1 year ago)
- Last Synced: 2024-11-07T07:51:54.698Z (about 2 months ago)
- Topics: stop, stop-word, stop-words, word, words
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/is-stop-words
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-stop-words
is-stop-words is a lightweight npm package that allows you to check whether a word is a stop word or not. Stop words are common words that are often filtered out or ignored in natural language processing tasks such as text analysis, search engines, and machine learning algorithms.
## Installation
You can install the package using npm:
```
npm install is-stop-words
```## Usage
```
const isStopWord = require('is-stop-words');console.log(isStopWord('the')); // Output: true
console.log(isStopWord('apple')); // Output: false
```The `isStopWord` function takes a word as input and returns `true` if it is a stop word, and `false` otherwise.
## Word Formatting
The `isStopWord` function performs the following formatting operations on the input word:
* Trims leading and trailing whitespace.
* Converts the word to lowercase.
* Ignores special characters other than the single quote '.These formatting operations ensure that the word comparison is case-insensitive and ignores leading/trailing spaces and special characters (except the single quote).