<commit_before>### StateMachine

A state machine with readable DSL.

```javascript
var stateMachine = new StateMachine()
        .state('error', new ErrorState())
        .error('error')
        .state('state1', new State1())
            .when('loaded').to('state2')
        .state('state2', new State2())
            .when(/.+-ready$/).to('work')<commit_msg>Fix StateMachine doc<commit_after>### StateMachine

A state machine with readable DSL.

```javascript
var stateMachine = new StateMachine()
        .error('error')                     // this declares the global error state
        .state('error', new ErrorState())
        .state('state1', new State1())
            .when('loaded').to('state2')
            .error('error')                 // this is error transition for state1
        .state('state2', new State2())
            .when(/.+-ready$/).to('work')
{'fraction_non_alphanumeric': 0.16244239631336405, 'fraction_numerical': 0.012672811059907835, 'mean_word_length': 2.3041825095057034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '614316', 'n_tokens_mistral': 240, 'n_tokens_neox': 229, 'n_words': 64}