<commit_before>Eloquent Geonames
=================

[![Build Status](https://travis-ci.org/ipalaus/eloquent-geonames.png?branch=master)](https://travis-ci.org/ipalaus/eloquent-geonames)

Installation
------------

Add `ipalaus/eloquent-geonames` as a requirement to composer.json:

```javascript
{
    "require": {
        "ipalaus/eloquent-geonames": "dev-master"
    }
}
```

Update your packages with `composer update` or install with `composer install`.

Once you have installed the dependency, you need to register `eloquent-geonames` in Laravel. Open your
`app/config/app.php` and add the next provider to your `providers` array:

```php
'Ipalaus\EloquentGeonames\EloquentGeonamesServiceProvider'
```

If you run now `php artisan` you should see a new namespace **geonames** with a few commands related to the package. In order to proceed with the install, run the next command:

```bash
$ php artisan geonames:install
```

This will publish the config file to `app/config/packages/ipalaus/eloquent-geonames/config.php` and run the migrations for you. Ideally, the package should publish the migrations but we will wait until the current pull request laravel/framework#2649  gets merged.

Artisan Commands
----------------

### Truncate

Do you want to truncate the table and start from scratch? Run:

```bash
$ php artisan geonames:truncate
```

GeoNames
--------

### Tables reference

I think the original table names are ugly... so I switched to a less uglier ones.

<table>
  <tr>
    <th>Original</th>
    <th>Eloquent Geonames</th>
  </tr>
  <tr>
    <td>geoname</td>
    <td>geonames_names</td>
  </tr>
  <tr>
    <td>alternatename</td>
    <td>geonames_alternate_names</td>
  </tr>
  <tr>
    <td>countryinfo</td>
    <td>geonames_countries</td>
  </tr>
  <tr>
    <td>iso_languagecodes</td>
    <td>geonames_language_codes</td>
  </tr>
  <tr>
    <td>admin1CodesAscii</td>
    <td>geonames_admin_divisions</td>
  </tr>
  <tr>
    <td>admin2Codes</td>
    <td>geonames_admin_subdivisions</td>
  </tr>
  <tr>
    <td>hierarchy</td>
    <td>geonames_hierarchy</td>
  </tr>
  <tr>
    <td>featureCodes</td>
    <td>geonames_features</td>
  </tr>
  <tr>
    <td>timeZones</td>
    <td>geonames_timezones</td>
  </tr>
  <tr>
    <td>continentCodes</td>
    <td>geonames_continents</td>
  </tr>


</table>
<commit_msg>Added coverage status to README.md<commit_after>Eloquent Geonames
=================

[![Build Status](https://travis-ci.org/ipalaus/eloquent-geonames.png?branch=master)](https://travis-ci.org/ipalaus/eloquent-geonames)
[![Coverage Status](https://coveralls.io/repos/ipalaus/eloquent-geonames/badge.png?branch=master)](https://coveralls.io/r/ipalaus/eloquent-geonames?branch=master)

Installation
------------

Add `ipalaus/eloquent-geonames` as a requirement to composer.json:

```javascript
{
    "require": {
        "ipalaus/eloquent-geonames": "dev-master"
    }
}
```

Update your packages with `composer update` or install with `composer install`.

Once you have installed the dependency, you need to register `eloquent-geonames` in Laravel. Open your
`app/config/app.php` and add the next provider to your `providers` array:

```php
'Ipalaus\EloquentGeonames\EloquentGeonamesServiceProvider'
```

If you run now `php artisan` you should see a new namespace **geonames** with a few commands related to the package. In order to proceed with the install, run the next command:

```bash
$ php artisan geonames:install
```

This will publish the config file to `app/config/packages/ipalaus/eloquent-geonames/config.php` and run the migrations for you. Ideally, the package should publish the migrations but we will wait until the current pull request laravel/framework#2649  gets merged.

Artisan Commands
----------------

### Truncate

Do you want to truncate the table and start from scratch? Run:

```bash
$ php artisan geonames:truncate
```

GeoNames
--------

### Tables reference

I think the original table names are ugly... so I switched to a less uglier ones.

<table>
  <tr>
    <th>Original</th>
    <th>Eloquent Geonames</th>
  </tr>
  <tr>
    <td>geoname</td>
    <td>geonames_names</td>
  </tr>
  <tr>
    <td>alternatename</td>
    <td>geonames_alternate_names</td>
  </tr>
  <tr>
    <td>countryinfo</td>
    <td>geonames_countries</td>
  </tr>
  <tr>
    <td>iso_languagecodes</td>
    <td>geonames_language_codes</td>
  </tr>
  <tr>
    <td>admin1CodesAscii</td>
    <td>geonames_admin_divisions</td>
  </tr>
  <tr>
    <td>admin2Codes</td>
    <td>geonames_admin_subdivisions</td>
  </tr>
  <tr>
    <td>hierarchy</td>
    <td>geonames_hierarchy</td>
  </tr>
  <tr>
    <td>featureCodes</td>
    <td>geonames_features</td>
  </tr>
  <tr>
    <td>timeZones</td>
    <td>geonames_timezones</td>
  </tr>
  <tr>
    <td>continentCodes</td>
    <td>geonames_continents</td>
  </tr>


</table>

{'fraction_non_alphanumeric': 0.15543613063249276, 'fraction_numerical': 0.0024803637866887144, 'mean_word_length': 3.661849710982659, 'pattern_counts': {'":': 4, '<': 139, '<?xml version=': 0, '>': 139, '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': '1578721', 'n_tokens_mistral': 1787, 'n_tokens_neox': 1741, 'n_words': 422}