Metadata-Version: 2.4
Name: docforge-swedish
Version: 0.1.0
Summary: Swedish NLP utilities for DocForge — zero external dependencies
Project-URL: Homepage, https://github.com/tomastimelock/DocLing
Project-URL: Repository, https://github.com/tomastimelock/DocLing
Author-email: Tomas Amlov <tomasamlov@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Tomas Amlov
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: kartan,ner,nlp,swedish,text-normalization
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# docforge-swedish

Swedish NLP utilities for the DocForge platform. Zero external dependencies — pure stdlib.

## Install

```bash
pip install docforge-swedish
# or locally:
pip install -e src/docforge_swedish
```

## Usage

```python
from docforge_swedish import (
    SwedishNormalizer,
    SwedishNER,
    SwedishFormats,
    SwedishStopwords,
    SwedishProcessor,
    Domain,
)

normalizer = SwedishNormalizer()
normalized = normalizer.normalize("socialtjänstlagen § 4 kap")
# → "SoL § 4 kap"

ner = SwedishNER()
entities = ner.extract("JO har granskat Socialnämnden i Stockholm")
print(entities.authorities)  # ['JO', 'Socialnämnden']

stopwords = SwedishStopwords.for_municipal()
filtered = stopwords.filter_text("nämnden beslutade att godkänna rapporten")
```

## Modules

| Module | Description |
|---|---|
| `SwedishNormalizer` | OCR fixes, law reference normalization, municipality/authority name normalization |
| `SwedishNER` | Rule-based named entity recognition (authorities, courts, law refs, persons, dates) |
| `SwedishFormats` | Date, SEK amount, personnummer parsing and formatting |
| `SwedishStopwords` | Domain-specific stopword sets (general, legal, municipal, social, medical) |
| `SwedishProcessor` | High-level pipeline combining all of the above |
| `Domain` | Enum for stopword domains |
