Metadata-Version: 2.4
Name: nerv-filter
Version: 0.1.0
Summary: Korean profanity filter with morphological analysis (Kiwi + Aho-Corasick)
Project-URL: Homepage, https://github.com/CSID-DGU/2025-2-CSED1-02-NERV-02
Project-URL: Repository, https://github.com/CSID-DGU/2025-2-CSED1-02-NERV-02
Author: NERV Team
License: MIT
License-File: LICENSE
Keywords: aho-corasick,filter,kiwi,korean,moderation,morphology,nlp,profanity
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Korean
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing :: Filters
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Requires-Dist: kiwipiepy>=0.17.0
Requires-Dist: pyahocorasick>=2.0.0
Provides-Extra: ai
Requires-Dist: openai>=1.0; extra == 'ai'
Provides-Extra: cli
Requires-Dist: click>=8.0; extra == 'cli'
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: click>=8.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: twine>=4.0; extra == 'dev'
Description-Content-Type: text/markdown

# nerv-filter

Korean profanity filter with morphological analysis (Kiwi + Aho-Corasick).

> ⚠️ **Status**: Alpha — API may change before v1.0

## Features

- 🔤 **Kiwi 형태소 분석기** 기반 정규화
- ⚡ **Aho-Corasick** 빠른 사전 매칭
- 📚 **7,600+ 변형 사전** 패키지 동봉
- 🎚️ **3단계 보안 수준** (LOW / MEDIUM / HIGH)
- ➕ **사용자 화이트/블랙리스트** 동적 갱신
- 📦 **배치 처리** 지원

## Installation

```bash
pip install nerv-filter
```

## Quick Start

```python
from nerv_filter import filter_text

result = filter_text("이 시발 새끼야")
print(result.action)         # ModerationAction.PARTIAL_MASK
print(result.masked_text)    # "이 ** 새끼야"
```

For repeated use, prefer instance reuse to avoid Kiwi reloading:

```python
from nerv_filter import NervFilter, SecurityLevel

flt = NervFilter(security_level=SecurityLevel.HIGH)

for text in texts:
    result = flt.analyze(text)
    print(result.action, result.masked_text)
```

## Documentation

- [Quick Start](docs/quickstart.md)
- [API Reference](docs/api_reference.md)
- [Examples](docs/examples/)

## Development

```bash
# Local install
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check src/ tests/
```

## License

This project (nerv-filter) is licensed under MIT — see [LICENSE](LICENSE).

### Third-Party Dependencies

`nerv-filter` builds on top of the following open-source libraries, installed
via standard `pip install` as runtime dependencies. Their licenses apply
respectively:

| Dependency | License | Source |
|---|---|---|
| [kiwipiepy](https://github.com/bab2min/kiwipiepy) | LGPL v3 | © Minchul Lee (bab2min) |
| [pyahocorasick](https://github.com/WojciechMula/pyahocorasick) | BSD-3-Clause | © Wojciech Muła |

**LGPL v3 Notice**: kiwipiepy is dynamically linked via Python import.
Users may replace it with a different version by running
`pip install kiwipiepy==<version>`. The kiwipiepy source code is available
at <https://github.com/bab2min/kiwipiepy> under LGPL v3, and a copy of the
license can be obtained at <https://www.gnu.org/licenses/lgpl-3.0.html>.

This project does **not** redistribute kiwipiepy code or model data.
