<commit_before># AddressSplitting

[![Build Status](https://img.shields.io/travis/VIISON/AddressSplitting.svg?style=flat-square)](https://travis-ci.org/VIISON/AddressSplitting) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Tries to split an address line into street name, house number and other additional information like building,
apartment information etc.

## Installation

This project can be installed via [Composer](https://getcomposer.org/):

``` bash
$ composer require viison/address-splitter
```

## Usage
The AddressSplittingService only contains one static function `splitAddress` that performs the address splitting.
The function expects one parameter, which is the address line. The function returns an associative array with the
keys `additionToAddress1`, `streetName`, `houseNumber` and `additionToAddress2`. `additionToAddress1` and `additionToAddress2`
contain information given in front of or after the street name & house number, respectively.

## Example
You can use the address splitting service as follows:

```php
var_dump(\VIISON\AddressSplitter\AddressSplitter::splitAddress('Pallaswiesenstr. 57B App. 235'));
```

The output of this command will be:

```php
array(4) {<commit_msg>Add packagist shield to README<commit_after># AddressSplitting

[![Packagist](https://img.shields.io/packagist/v/viison/address-splitter.svg?style=flat-square)](https://packagist.org/packages/viison/address-splitter) [![Build Status](https://img.shields.io/travis/VIISON/AddressSplitting.svg?style=flat-square)](https://travis-ci.org/VIISON/AddressSplitting) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)

Tries to split an address line into street name, house number and other additional information like building,
apartment information etc.

## Installation

This project can be installed via [Composer](https://getcomposer.org/):

``` bash
$ composer require viison/address-splitter
```

## Usage
The AddressSplittingService only contains one static function `splitAddress` that performs the address splitting.
The function expects one parameter, which is the address line. The function returns an associative array with the
keys `additionToAddress1`, `streetName`, `houseNumber` and `additionToAddress2`. `additionToAddress1` and `additionToAddress2`
contain information given in front of or after the street name & house number, respectively.

## Example
You can use the address splitting service as follows:

```php
var_dump(\VIISON\AddressSplitter\AddressSplitter::splitAddress('Pallaswiesenstr. 57B App. 235'));
```

The output of this command will be:

```php
array(4) {
{'fraction_non_alphanumeric': 0.10959409594095941, 'fraction_numerical': 0.007380073800738007, 'mean_word_length': 6.210106382978723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, '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': '3536131', 'n_tokens_mistral': 809, 'n_tokens_neox': 748, 'n_words': 239}