<commit_before># Architecture

## Overview

![overview](https://monosnap.com/file/7XRjyiTviKHE4t4CAeYzh6UuBc3zGp.png)

```
title: Architecture
CLI->Engine: file*s*
Engine->Core: file
Core->Task: AST
Task->Task: Lint
Task-->Core: Message
Core-->Engine: Results
Engine-->CLI: output
```

- CLI know Engine
- Engine know Core

## CLI

- [options.js](./options.js)
    - Parse cli options
- [cli.js](./cli.js)
    - create config
    - run engine
    - output result
    
## Engine

Process file**s** are wanted to lint/fix and prepare configuration of rules and plugins.

- engine/ directory
- textlint-engine.js
- rule-manager.js
- textlint-module-resolver.js

These are shared between config and engine.
Don't shared between engine and core.

## Core

Process file/text wanted to lint/fix

- `core/` directory
- textlint-core.js
- source-code.js
- rule-creator-set.js
- task/
- linter/
- fixer/

## Shared

These are shared between config and engine and core.

- rule-severity
- union-syntax<commit_msg>docs(src): add difference of linter and fixer<commit_after># Architecture

## Overview

![overview](https://monosnap.com/file/7XRjyiTviKHE4t4CAeYzh6UuBc3zGp.png)

```
title: Architecture
CLI->Engine: file*s*
Engine->Core: file
Core->Task: AST
Task->Task: Lint
Task-->Core: Message
Core-->Engine: Results
Engine-->CLI: output
```

- CLI know Engine
- Engine know Core

## CLI

- [options.js](./options.js)
    - Parse cli options
- [cli.js](./cli.js)
    - create config
    - run engine
    - output result
    
## Engine

Process file**s** are wanted to lint/fix and prepare configuration of rules and plugins.

- engine/ directory
- textlint-engine.js
- rule-manager.js
- textlint-module-resolver.js

These are shared between config and engine.
Don't shared between engine and core.

## Core

Process file/text wanted to lint/fix

- `core/` directory
- textlint-core.js
- source-code.js
- rule-creator-set.js
- task/
- linter/
- fixer/

To be clear about difference of linter and fixer.

- *Linter** process in parallel.
- *Fixer* process in series.

## Shared

These are shared between config and engine and core.

- rule-severity
- union-syntax
{'fraction_non_alphanumeric': 0.12790697674418605, 'fraction_numerical': 0.004651162790697674, 'mean_word_length': 3.327967806841046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1592919', 'n_tokens_mistral': 765, 'n_tokens_neox': 734, 'n_words': 214}