<commit_before>Java Example
============

This is a simple example showing how to access the
[xmlstats](https://erikberg.com/api) API using Java. Example program listings
show two ways to create an HTTP request. One uses [Apache
HttpComponents](https://hc.apache.org/) and the other uses
[java.net](https://docs.oracle.com/javase/8/docs/api/java/net/package-summary.html)
packages. Both examples consume the HTTP response and deserialize the JSON data
into a POJO using [Jackson](https://github.com/FasterXML/jackson).

Requirements
------------
To run this example, you will need JDK 8, [Maven](https://maven.apache.org/)
3.x, and an xmlstats account.

Getting Started
---------------
Clone the repository.

### Configure
Specify your API access token and e-mail address in
`src/main/resources/xmlstats.properties`.

### Compile
`mvn compile`

### Run
Using Apache HttpComponents (recommended)
```
mvn exec:java -Dexec.mainClass=com.xmlstats.example.ExampleApacheHttp
```

Using java.net
```
mvn exec:java -Dexec.mainClass=com.xmlstats.example.ExampleJavaNet`
```
<commit_msg>Formatting.<commit_after>Java Example
============

This is a simple example showing how to access the
[xmlstats](https://erikberg.com/api) API using Java. Example program listings
show two ways to create an HTTP request. One uses [Apache
HttpComponents](https://hc.apache.org/) and the other uses
[java.net](https://docs.oracle.com/javase/8/docs/api/java/net/package-summary.html)
packages. Both examples consume the HTTP response and deserialize the JSON data
into a POJO using [Jackson](https://github.com/FasterXML/jackson).

Requirements
------------
To run this example, you will need JDK 8, [Maven](https://maven.apache.org/)
3.x, and an xmlstats account.

Getting Started
---------------
Clone the repository.

### Configure
Specify your API access token and e-mail address in
`src/main/resources/xmlstats.properties`.

### Compile
`mvn compile`

### Run
Using Apache HttpComponents (recommended)
```
mvn exec:java -Dexec.mainClass=com.xmlstats.example.ExampleApacheHttp
```

Using java.net
```
mvn exec:java -Dexec.mainClass=com.xmlstats.example.ExampleJavaNet
```

{'fraction_non_alphanumeric': 0.14783821478382148, 'fraction_numerical': 0.002789400278940028, 'mean_word_length': 4.300492610837439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '2507979', 'n_tokens_mistral': 663, 'n_tokens_neox': 636, 'n_words': 202}