<commit_before>posiy
====
There are notably two approaches to regular expression matching. One is in widespread use in the standard interpreted languages like Ruby, Perl, PHP. The other is used in few places, for example awk and grep.

The latter is called Thompson's Construction (Thompson NFA), sometimes called McNaughton-Yamada-Thompson's algorithm. The algorithm is syntax-directed, in the sense that it works recursively up the parse tree for the regular expression. For each subexpression the algorithm constructs an NFA with a single accepting state.

Example.
-----------
---------------

The Thompson NFA for the regular expression `a|b` is:

![NFA](http://hackingoff.com/images/re2nfa/2014-10-26_18-04-44_-0700-nfa.svg)

`a*`:
![NFA](http://hackingoff.com/images/re2nfa/2014-10-26_21-02-20_-0700-nfa.svg).

NFA's (non-deterministic finate automata) in terms of Regular Expressions are easier to create; however, DFA's have the special characteristic of being faster state machines.

There is a well known algorithm known as Subset Construction for converting `NFA -> DFA`.

The DFA of `a|b` from the above NFA: 
![DFA](http://hackingoff.com/images/re2nfa/2014-10-26_21-06-09_-0700-dfa.svg).

What is posiy?
-----------------
------------------------

Posiy is my implementation of Thompson-McNaughton-Yamada construction NFA from Regular Expressions In JavaScript. I initially planned to implement only the Union, Kleene-star,  and Concatenation operators. However this is very likely to expand and I will keep updates documented.<commit_msg>readability<commit_after>posiy
====
There are notably two approaches to regular expression matching. One is in widespread use in the standard interpreted languages like Ruby, Perl, PHP. The other is used in few places, for example awk and grep.

The latter is called Thompson's Construction (Thompson NFA), sometimes called McNaughton-Yamada-Thompson's algorithm. The algorithm is syntax-directed, in the sense that it works recursively up the parse tree for the regular expression. For each subexpression the algorithm constructs an NFA with a single accepting state.

Example.
---------

The Thompson NFA for the regular expression `a|b` is:

![NFA](http://hackingoff.com/images/re2nfa/2014-10-26_18-04-44_-0700-nfa.svg)

`a*`:

![NFA](http://hackingoff.com/images/re2nfa/2014-10-26_21-02-20_-0700-nfa.svg).

NFA's (non-deterministic finate automata) in terms of Regular Expressions are easier to create; however, DFA's have the special characteristic of being faster state machines.

There is a well known algorithm known as Subset Construction for converting `NFA -> DFA`.

The DFA of `a|b` from the above NFA: 

![DFA](http://hackingoff.com/images/re2nfa/2014-10-26_21-06-09_-0700-dfa.svg).

What is posiy?
---------------

Posiy is my implementation of Thompson-McNaughton-Yamada construction NFA from Regular Expressions In JavaScript. I initially planned to implement only the Union, Kleene-star,  and Concatenation operators. However this is very likely to expand and I will keep updates documented.
{'fraction_non_alphanumeric': 0.1074812152891212, 'fraction_numerical': 0.037242731133616466, 'mean_word_length': 4.019672131147541, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6042513', 'n_tokens_mistral': 953, 'n_tokens_neox': 863, 'n_words': 361}