<commit_before>[![License](https://poser.pugx.org/arodygin/php-dictionary/license)](https://packagist.org/packages/arodygin/php-dictionary)
[![Latest Stable Version](https://poser.pugx.org/arodygin/php-dictionary/v/stable)](https://packagist.org/packages/arodygin/php-dictionary)
[![Build Status](https://travis-ci.org/arodygin/php-dictionary.svg?branch=master)](https://travis-ci.org/arodygin/php-dictionary)
[![Code Coverage](https://scrutinizer-ci.com/g/arodygin/php-dictionary/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/arodygin/php-dictionary/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/arodygin/php-dictionary/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/arodygin/php-dictionary/?branch=master)

# Static dictionary implementation for PHP

## Requirements

PHP needs to be a minimum version of PHP 5.4.

## Installation

The recommended way to install is via Composer:

```bash
composer.phar require "arodygin/php-dictionary"
composer.phar install
```

## Usage

To create custom dictionary you have to extend `StaticDictionary` class and implement the `all` function, which must return your dictionary as associated array.
After that you can use [`StaticDictionaryInterface`](https://github.com/arodygin/php-dictionary/blob/master/src/StaticDictionaryInterface.php) interface to work with your dictionary.

Example dictionary:

```php
namespace Dictionary;

class Color extends StaticDictionary
{
    const BLACK   = 'Black';
    const BLUE    = 'Blue';<commit_msg>Cosmetic changes<commit_after>[![License](https://poser.pugx.org/arodygin/php-dictionary/license)](https://packagist.org/packages/arodygin/php-dictionary)
[![Latest Stable Version](https://poser.pugx.org/arodygin/php-dictionary/v/stable)](https://packagist.org/packages/arodygin/php-dictionary)
[![Build Status](https://travis-ci.org/arodygin/php-dictionary.svg?branch=master)](https://travis-ci.org/arodygin/php-dictionary)
[![Code Coverage](https://scrutinizer-ci.com/g/arodygin/php-dictionary/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/arodygin/php-dictionary/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/arodygin/php-dictionary/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/arodygin/php-dictionary/?branch=master)

# Static dictionary implementation for PHP

## Requirements

PHP needs to be a minimum version of PHP 5.4.

## Installation

The recommended way to install is via Composer:

```bash
composer require "arodygin/php-dictionary"
composer install
```

## Usage

To create custom dictionary you have to extend `StaticDictionary` class and implement the `all` function, which must return your dictionary as associated array.
After that you can use [`StaticDictionaryInterface`](https://github.com/arodygin/php-dictionary/blob/master/src/StaticDictionaryInterface.php) interface to work with your dictionary.

Example dictionary:

```php
namespace Dictionary;

class Color extends StaticDictionary
{
    const BLACK   = 'Black';
    const BLUE    = 'Blue';
{'fraction_non_alphanumeric': 0.14001953760989905, 'fraction_numerical': 0.0013025073266037122, 'mean_word_length': 5.678260869565217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, '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': '549370', 'n_tokens_mistral': 1008, 'n_tokens_neox': 951, 'n_words': 186}