<commit_before>Browser Capabilities Project
============================

This tool is used to build and maintain browscap files.

## Install

```
$ git clone git://github.com/browscap/browscap.git
$ cd browscap
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install
```

## Usage

```
bin/browscap build [version]
```

For further documentation on the `build` command, [see here](https://github.com/browscap/browscap/wiki/Build-Command).

## Demonstrating Functionality

In order to show what the tool can do after you have cloned and installed dependencies, first obtain an original browscap INI, recommended to be the `full_asp_browscap.ini`, then do something like this:

```
$ cd resources
$ rm -R user-agents
$ bin/browscap import build/full_asp_browscap_5020.ini
Written 1 user agents to JSON: defaultproperties.json
Written 3 user agents to JSON: ask.json
Written 12 user agents to JSON: baidu.json
...
Written 11 user agents to JSON: ie-9-0.json
Written 1 user agents to JSON: default-browser.json
$
```

Now if you examine the resources/user-agents folder, you will see many hundreds of JSON files containing the UAs.

Then you can export a new browscap.ini from the JSON files:

```
$ bin/browscap build 5020-test
Processing file ./resources/user-agents/palm-web.json ...
Processing file ./resources/user-agents/chromium-30-0.json ...
Processing file ./resources/user-agents/mozilla-1-5.json ...
...
Processing file ./resources/user-agents/iron-10-0.json ...
Processing file ./resources/user-agents/opera-12-12.json ...
Generating browscap.ini
All done.
$
```

Now you if you look at `browscap/browscapTest.ini` you will see a new INI file has been generated.

Then you can compare to your original `full_asp_browscap.ini` to check for differences:

```
$ bin/browscap diff build/browscapTest.ini build/full_asp_browscap_5020.ini
The following differences have been found:
<commit_msg>Updated output<commit_after>Browser Capabilities Project
============================

This tool is used to build and maintain browscap files.

## Install

```
$ git clone git://github.com/browscap/browscap.git
$ cd browscap
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install
```

## Usage

```
bin/browscap build [version]
```

For further documentation on the `build` command, [see here](https://github.com/browscap/browscap/wiki/Build-Command).

## Demonstrating Functionality

In order to show what the tool can do after you have cloned and installed dependencies, first obtain an original browscap INI, recommended to be the `full_asp_browscap.ini`, then do something like this:

```
$ cd resources
$ rm -R user-agents
$ bin/browscap import build/full_asp_browscap_5020.ini
Written 1 user agents to JSON: defaultproperties.json
Written 3 user agents to JSON: ask.json
Written 12 user agents to JSON: baidu.json
...
Written 11 user agents to JSON: ie-9-0.json
Written 1 user agents to JSON: default-browser.json
$
```

Now if you examine the resources/user-agents folder, you will see many hundreds of JSON files containing the UAs.

Then you can export a new browscap.ini from the JSON files:

```
$ bin/browscap build 5020-test
Processing file ./resources/user-agents/palm-web.json ...
Processing file ./resources/user-agents/chromium-30-0.json ...
Processing file ./resources/user-agents/mozilla-1-5.json ...
...
Processing file ./resources/user-agents/iron-10-0.json ...
Processing file ./resources/user-agents/opera-12-12.json ...
Generating browscapTest_asp_full.ini [ASP/FULL]
Generating browscapTest_php_full.ini [PHP/FULL]
Generating browscapTest_asp.ini [ASP]
Generating browscapTest_php.ini [PHP]
All done.
$
```

Now you if you look at `browscap/browscapTest.ini` you will see a new INI file has been generated.

Then you can compare to your original `full_asp_browscap.ini` to check for differences:

```
$ bin/browscap diff build/browscapTest.ini build/full_asp_browscap_5020.ini
The following differences have been found:

{'fraction_non_alphanumeric': 0.11412089290193128, 'fraction_numerical': 0.01655379984951091, 'mean_word_length': 4.310252996005326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '2290396', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1211, 'n_words': 423}