Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rap2hpoutre/remove-stop-words

Remove stop words from a string
https://github.com/rap2hpoutre/remove-stop-words

composer library package packagist php php-library php7

Last synced: 3 months ago
JSON representation

Remove stop words from a string

Awesome Lists containing this project

README

        

# Remove stop words

[![Packagist](https://img.shields.io/packagist/l/rap2hpoutre/remove-stop-words.svg)](https://packagist.org/packages/rap2hpoutre/remove-stop-words)
[![Build Status](https://travis-ci.org/rap2hpoutre/remove-stop-words.svg?branch=master)](https://travis-ci.org/rap2hpoutre/remove-stop-words)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/rap2hpoutre/remove-stop-words/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/rap2hpoutre/remove-stop-words/?branch=master)

Remove stop words from a string. It currently works in French, Spanish and English. Feel free to submit a Pull Request if you want to include your language.

## Installation

```bash
composer require rap2hpoutre/remove-stop-words
```

## Usage

Just call the `remove_stop_words` function with a string.

```php
use function Rap2hpoutre\RemoveStopWords\remove_stop_words;

echo remove_stop_words('The quick brown fox jumps over the lazy dog');
// quick brown fox jumps lazy dog
```
You can provide a locale as a second argument:

```php
use function Rap2hpoutre\RemoveStopWords\remove_stop_words;

echo remove_stop_words('Portez ce vieux whisky au juge blond qui fume', 'fr');
// Portez vieux whisky juge blond fume
```