<commit_before># PHP UCD

[![Build Status](https://travis-ci.org/nick-jones/php-ucd.svg?branch=master)](https://travis-ci.org/nick-jones/php-ucd)

This project aims to provide a PHP interface into the [Unicode Character Database](http://unicode.org/ucd/) (UCD).
It provides a means to lookup, filter, and interrogate the metadata of characters that reside within the UCD.

This is still work-in-progress, and not yet intended for general purpose use.

## Installation

This will be added to Packagist once initial development is complete.

## Usage

Simply create an instance of `\UCD\UCD`, and utilise the methods on its interface. For example, if you wished to
dump all numeric characters, you could use something similar to:

```php
use UCD\Entity\Character;
use UCD\Entity\Character\Properties\Numericity\Numeric;
use UCD\View\CharacterView;
use UCD\UCD;

$filter = function (Character $character) {
    $properties = $character->getProperties();
    $numericity = $properties->getNumericity();
<commit_msg>Scrutinizer CI badge added to README<commit_after># PHP UCD

[![Build Status](https://travis-ci.org/nick-jones/php-ucd.svg?branch=master)](https://travis-ci.org/nick-jones/php-ucd) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nick-jones/php-ucd/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nick-jones/php-ucd/?branch=master)

This project aims to provide a PHP interface into the [Unicode Character Database](http://unicode.org/ucd/) (UCD).
It provides a means to lookup, filter, and interrogate the metadata of characters that reside within the UCD.

This is still work-in-progress, and not yet intended for general purpose use.

## Installation

This will be added to Packagist once initial development is complete.

## Usage

Simply create an instance of `\UCD\UCD`, and utilise the methods on its interface. For example, if you wished to
dump all numeric characters, you could use something similar to:

```php
use UCD\Entity\Character;
use UCD\Entity\Character\Properties\Numericity\Numeric;
use UCD\View\CharacterView;
use UCD\UCD;

$filter = function (Character $character) {
    $properties = $character->getProperties();
    $numericity = $properties->getNumericity();

{'fraction_non_alphanumeric': 0.11341134113411341, 'fraction_numerical': 0.0, 'mean_word_length': 4.85, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 6, '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': '994999', 'n_tokens_mistral': 690, 'n_tokens_neox': 671, 'n_words': 224}