<commit_before># FRACTRAN

Implementation of <NAME>'s esoteric FRACTRAN programming language in Go.

## Licence

```
The MIT License (MIT)
<commit_msg>Updates README<commit_after># FRACTRAN

Implementation of <NAME>'s esoteric FRACTRAN programming language in Go.

# Installation

```
# go get github.com/jgalilee/fractran
# go install github.com/jgalilee/fractran
```

## Example

Source file `primes.ft`. The grammar currently disallows white space or new
lines.

```
17/91,78/85,19/51,23/38,29/33,77/29,95/23,77/19,1/17,11/13,13/11,15/14,15/2,55/1
```

Usage depends on whether there is a piped file. There is either one or two args
depending. The last argument is the initial value of n.

The following two commands are equivalent.

```
# cat eg/primes.ft | fractran 2
# fractran eg/primes.ft 2
```

# Use in Go programs

The internal package `github.com/jgalilee/fractran/lang` exposes two types
the `Program` type and the `Parser` type. The `Parser` type only accepts the
highly simplistic grammar as shown in the example.

## Licence

```
The MIT License (MIT)

{'fraction_non_alphanumeric': 0.10955056179775281, 'fraction_numerical': 0.05149812734082397, 'mean_word_length': 4.371859296482412, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '4452054', 'n_tokens_mistral': 410, 'n_tokens_neox': 369, 'n_words': 125}