# @textlint-rule/rousseau

> Lightweight proofreader

Latest version **2.0.4** (published 2023-01-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @textlint-rule/rousseau
pnpm add @textlint-rule/rousseau
yarn add @textlint-rule/rousseau
bun add @textlint-rule/rousseau
```

Provides the command `rousseau`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2023-01-28 |
| First published | 2022-09-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 155.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | GitBook |
| Maintainers | azu, nodaguti, 0x6b, hata6502, textlint-user |
| Keywords | proofreading, language, native, spellcheck |

## Links

- npm: https://www.npmjs.com/package/@textlint-rule/rousseau
- Repository: https://github.com/textlint-rule/rousseau
- Issues: https://github.com/textlint-rule/rousseau/issues
- npm.io page: https://npm.io/package/@textlint-rule/rousseau

## Dependencies (9)

- [crc](https://npm.io/package/crc.md) ^4.3.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [cli-table](https://npm.io/package/cli-table.md) ^0.3.11
- [bash-color](https://npm.io/package/bash-color.md) ^0.0.4
- [find-line-column](https://npm.io/package/find-line-column.md) 0.5.2
- [simple-lru-cache](https://npm.io/package/simple-lru-cache.md) ^0.0.2
- [@textlint-rule/tokenize-text](https://npm.io/package/@textlint-rule/tokenize-text.md) ^2.0.2
- [@textlint-rule/tokenize-english](https://npm.io/package/@textlint-rule/tokenize-english.md) ^2.0.2
- [@textlint-rule/tokenize-htmltext](https://npm.io/package/@textlint-rule/tokenize-htmltext.md) ^2.0.2

## Recent versions

- 2.0.4 (latest) — 2023-01-28
- 2.0.2 — 2022-09-10
- 2.0.1 — 2022-09-10
- 2.0.0 — 2022-09-10

## README

![Rousseau](./preview.jpg)

Rousseau is a lightweight proofreader written in Javascript, it can be used in Node.JS, in the command line and in the browser.

### Installation

```
$ npm install @textlint-rule/rousseau
```

### API

```js
var rousseau = require("@textlint-rule/rousseau");

rousseau('So the cat was stolen.', function(err, results) {
    ...
});
```

`results` is an array of object like:

```js
{
    // Type of check that output this suggestion
    type: "so",

    // Level of importance
    // "suggestion", "warning", "error"
    level: "warning",

    // Index in the text
    index: 10,

    // Size of the section in the text
    offset: 2,

    // Message to describe the suggestion
    message: "omit 'So' from the beginning of sentences",

    // Replacements suggestion
    replacements: [
        {
            value: ""
        }
    ]
}
```

### Checks

You can disable any combination of the following by providing a key with value `false` as option `checks` to `rousseau`.

##### English

| ID    | Description     |
| ----- | --------------- |
| `passive` | Checks for passive voice |
| `lexical-illusion` | Checks for lexical illusions – cases where a word is repeated. |
| `so` | Checks for `so` at the beginning of the sentence. |
| `adverbs` | Checks for adverbs that can weaken meaning: really, very, extremely, etc. |
| `readibility` | Checks for readibility of sentences. |
| `simplicity` | Checks for simpler expressions |
| `weasel` | Checks for "weasel words." |
| `sentence:start` | Checks that sentence is preceded by a space |
| `sentence:end` | Checks that there is no space between a sentence and its ending punctuation |
| `sentence:uppercase` | Checks that sentences are starting with uppercase letter |


### Extend Rousseau

Example: Extend rousseau with a Spellchecker.

```js
rousseau("Some text", {
    checks: {
        spelling: rousseau.tokenize.check([
            rousseau.tokenize.words(),
            rousseau.filter(function(word) {
                return wordIsValid(word);
            }),
            rousseau.define({
                level: rousseau.levels.ERROR,
                message: "Spelling error"
            })
        ])
    }
}, function(err, results) {
    ...
})

```

### Cache

Rousseau use an internal cache for certain operations (tokenization, spellchecking, ...); this cache can be configured using the option `cache`:

```js
rousseau('So the cat was stolen.', {
    cache: 100 // A maximum of 100 elements will be stored in the memory cache
}, function(err, results) {
    ...
});
```

### Contributing

We'd love to accept your patches and contributions to improve Rousseau (supported languages, checks, ...). Learn more about how to contribute in [CONTRIBUTING.md](./CONTRIBUTING.md).

---
_Source: https://npm.io/package/@textlint-rule/rousseau · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
