<commit_before>ArrayTree
=========

ArrayTree is a tool for converting 2-d array to tree structure array.

Here is an example:

```php
$dataList = array(
    array(
        'id'        => 1,
        'parent_id' => 0,
        'name'      => 'games'
    ),
    array(
        'id'        => 2,
        'parent_id' => 1,
        'name'      => 'TV games'
    ),
    array(
        'id'        => 3,
        'parent_id' => 2,
        'name'      => 'ACT'
    ),
);

//Converting
$dataTree = new \ArrayTree\Tree($dataList);

$dataTree->setIdKey('id');
$dataTree->setParentIdKey('parent_id');
$dataTree->setResultChildKey('childs');
$dataTree->setResultParentIdsKey('parent_ids');

$dataTreeList = $dataTree->getArrayTree();<commit_msg>make description more accurate<commit_after>ArrayTree
=========

ArrayTree is a tool for converting 2-d array to tree structure(nested or hierarchical) array.


Here is an example:

```php
$dataList = array(
    array(
        'id'        => 1,
        'parent_id' => 0,
        'name'      => 'games'
    ),
    array(
        'id'        => 2,
        'parent_id' => 1,
        'name'      => 'TV games'
    ),
    array(
        'id'        => 3,
        'parent_id' => 2,
        'name'      => 'ACT'
    ),
);

//Converting
$dataTree = new \ArrayTree\Tree($dataList);

$dataTree->setIdKey('id');
$dataTree->setParentIdKey('parent_id');
$dataTree->setResultChildKey('childs');
$dataTree->setResultParentIdsKey('parent_ids');

$dataTreeList = $dataTree->getArrayTree();
{'fraction_non_alphanumeric': 0.1744340878828229, 'fraction_numerical': 0.009320905459387484, 'mean_word_length': 2.4081632653061225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, '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': '3884024', 'n_tokens_mistral': 532, 'n_tokens_neox': 504, 'n_words': 108}