<commit_before># xOCaml

Exercism Exercises in OCaml

## Contributing Guide

Contributions to the OCaml track (or any other part of Exercism) are very welcome!

Please see the [contributing guide](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md) for overall guidance. The below
notes contain a few details specific to Ocaml.

## Prerequisites

The OCaml track assumes installation of OCaml version 4.04.1, and installation of Core, OUnit, and React (for the Hangman exercise).
Assuming you have opam, these can be installed with
```bash
opam install core ounit react
```

## Running Tests

To run all the tests, type `make` from the top level ocaml directory.

To run tests for an individual exercise, `make test-assignment ASSIGNMENT=luhn`

## Adding an Exercise

The [contributing guide](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md) provides guidance on
how to add a new exercise, or port an existing exercise from another language track. This is a brief guide, with specifics for the OCaml stream.

Firstly, register the exercise in [config json](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md#configjson). The name of the exercise should go in the "slug" entry.

Then, write the exercise tests & proof of concept implementation.
A folder layout for an exercise called "ocaml-exercise" is below.

```
└── exercises
    └── ocaml-exercise
        ├── .merlin (provided IDE assistance - copy this from any of the other Ocaml exercises)
        ├── example.ml (a proof of concept implementation)
        ├── ocaml_exercise.mli (the interface definition for the exercise)
        ├── HINTS.md (additional hints to anyone trying the exercise - optional)<commit_msg>Link to new contributing documentation<commit_after># xOCaml

Exercism Exercises in OCaml

## Contributing Guide

Contributions to the OCaml track (or any other part of Exercism) are very welcome!

Please see the [contributing guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md) for overall guidance. The below
notes contain a few details specific to Ocaml.

## Prerequisites

The OCaml track assumes installation of OCaml version 4.04.1, and installation of Core, OUnit, and React (for the Hangman exercise).
Assuming you have opam, these can be installed with
```bash
opam install core ounit react
```

## Running Tests

To run all the tests, type `make` from the top level ocaml directory.

To run tests for an individual exercise, `make test-assignment ASSIGNMENT=luhn`

## Adding an Exercise

The [contributing guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md) provides guidance on
how to add a new exercise, or port an existing exercise from another language track. This is a brief guide, with specifics for the OCaml stream.

Firstly, register the exercise in [config json](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md#configjson). The name of the exercise should go in the "slug" entry.

Then, write the exercise tests & proof of concept implementation.
A folder layout for an exercise called "ocaml-exercise" is below.

```
└── exercises
    └── ocaml-exercise
        ├── .merlin (provided IDE assistance - copy this from any of the other Ocaml exercises)
        ├── example.ml (a proof of concept implementation)
        ├── ocaml_exercise.mli (the interface definition for the exercise)
        ├── HINTS.md (additional hints to anyone trying the exercise - optional)
{'fraction_non_alphanumeric': 0.08132615471805044, 'fraction_numerical': 0.002266931141966563, 'mean_word_length': 4.316265060240964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2692058', 'n_tokens_mistral': 1034, 'n_tokens_neox': 998, 'n_words': 435}