# Sutton-SignWriting/Core

_Version: 1.0.1_

[![Source Code on GitHub](https://img.shields.io/badge/source-GitHub-lightgrey?logo=github)](https://github.com/sutton-signwriting/core-php)
[![Docs](https://img.shields.io/badge/docs-sutton--signwriting.io-blue)](https://www.sutton-signwriting.io/core-php)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sutton-signwriting/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Spec](https://img.shields.io/badge/spec-Formal%20SignWriting-blueviolet)](https://datatracker.ietf.org/doc/html/draft-slevinski-formal-signwriting)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17553763.svg)](https://doi.org/10.5281/zenodo.17553763)
[![Packagist](https://img.shields.io/packagist/v/sutton-signwriting/core)](https://packagist.org/packages/sutton-signwriting/core)
[![Packagist PHP](https://img.shields.io/packagist/php-v/sutton-signwriting/core)](https://packagist.org/packages/sutton-signwriting/core)
[![Packagist Downloads](https://img.shields.io/packagist/dt/sutton-signwriting/core)](https://packagist.org/packages/sutton-signwriting/core)
[![CI](https://github.com/sutton-signwriting/core-php/actions/workflows/ci.yml/badge.svg)](https://github.com/sutton-signwriting/core-php/actions/workflows/ci.yml)
[![Docs Build](https://github.com/sutton-signwriting/core-php/actions/workflows/docs.yml/badge.svg)](https://github.com/sutton-signwriting/core-php/actions/workflows/docs.yml)

_Package: `sutton-signwriting/core` — PHP 7.3+ and PHP 8.x (requires `ext-mbstring`)._

## Getting Started

### 1) Install (Composer)

```bash
composer require sutton-signwriting/core
```

Core utilities for Formal SignWriting (FSW/SWU): conversion, queries, and style strings.

### 2) Source Modules + Functions (src/)
Use the namespaced modules directly, or explicitly include the optional global wrappers from `src/Functions`.

```php
use Sgnw\Core\Convert;
Convert\swu_to_fsw($swuText);

// Optional global wrappers (explicit require)
require_once 'src/Functions/convert.php';
swu_to_fsw($swuText);
```

## Modules

- **Regex** — Centralized regex patterns for FSW, FSW Query, Style, SWU, and SWU Query. ([HTML](module-regex.html), [MD](regex.md))
- **Convert** — Conversions between FSW and SWU, symbol keys/ids, coordinates, and symid helpers. ([HTML](module-convert.html), [MD](convert.md))
- **FSW** — Formal SignWriting (FSW) parsing, composition, and helpers. ([HTML](module-fsw.html), [MD](fsw.md))
- **FSW Query** — FSW query parsing, composition, and result helpers. ([HTML](module-fswquery.html), [MD](fswquery.md))
- **SWU** — SignWriting in Unicode (SWU) parsing, composition, and helpers. ([HTML](module-swu.html), [MD](swu.md))
- **SWU Query** — SWU query parsing, composition, and result helpers. ([HTML](module-swuquery.html), [MD](swuquery.md))
- **Style** — Style helpers for colors and style strings. ([HTML](module-style.html), [MD](style.md))
- **Shared** — Shared utilities used across modules. ([HTML](module-shared.html), [MD](shared.md))
