<commit_before>WIP

## Create LSystem Object

```.js
let myLsystem = new LSystem([options])
```

**Options**

- `axiom`: The initial word/string of your L-System. Sometimes also called *initiator*. This can be either a String like `'ABC'` or an Array of Objects  in the form: `[{symbol: 'A'}, {symbol: B}, {symbol: C}]`. The axiom can also bet set later via `setAxiom()`.

- `productions`: Key-value Object to set the productions from one symbol to its axiom. Applied when calling `iterate()`. A production can either be a String, Object, Array of Objects or a Function. [More on productions further below.](#productions)

- `finals`: Optional key-value Object to set Functions be executed for each symbol in sequential order. Useful for visualization. Used when calling `final()`.

- `allowClassicSyntax`: Toggles support for [classic syntax features](#classic-syntax-features) that often are more concise and mirror examples in the book better but are also less flexible.
default: `true`.

- `branchSymbols`: A String tuple of the symbols treated as branches. default: `'[]'`

- `ignoredSymbols`: A String of symbols to ignore when performing context sensitive checks. Eg. you may want to define `+-` in two-dimensional turtle-graphic L-Systems to be ignored. default: `''`.

- `forceObjects`: Toggles automatic conversion of Strings into Objects. Eg. axiom 'AB' gets converted to [{symbol: 'A'}, {symbol: 'B'}]. default: `false`.



### Example Usage

#### Basic
```.js
let myLsystem = new LSystem({
	axiom: 'F',
	productions: {
		'F': 'F-A',
		'A': 'FF++FA'
	}
})
```

#### Context sensitive (using production objects, more below)
```.js
let myLsystem = new LSystem({
	axiom: ['ABCDE'],
	productions: {
		'A': 'A+AAC',
		'B': {leftCtx: 'A', successor: 'A'},
		'C': {rightCtx: 'D', successor: 'ABCD'}
	}
})
```


#### Context sensitive (using classic ABOP-syntax)
This one is semantically equivalent to the previous example, but uses the classic syntax which is supported by default ([can be turned off](#LSystem-options)).
```.js
let myLsystem = new LSystem({
	axiom: ['ABCDE'],
	productions: {
		'A'		: 'A+AAC',
	'A<B'		: 'A',
		'C>DE': 'ABCD'
	}
})
```

## Productions (#productions)

You can set productions in two ways.

Multiple productions via constructor:
```.js
let myLsystem = new LSystem({
	productions: {
		[symbol]: [production],
		[symbol]: [production]
	}
})
```

Or via their setter-methods:
```.js
// Set single production
myLsystem.setProduction([symbol], [production])<commit_msg>Update index.md<commit_after>WIP

## Create LSystem Object

```.js
let myLsystem = new LSystem([options])
```

**Options**

- `axiom`: The initial word/string of your L-System. Sometimes also called *initiator*. This can be either a String like `'ABC'` or an Array of Objects  in the form: `[{symbol: 'A'}, {symbol: B}, {symbol: C}]`. The axiom can also bet set later via `setAxiom()`.

- `productions`: Key-value Object to set the productions from one symbol to its axiom. Applied when calling `iterate()`. A production can either be a String, Object, Array of Objects or a Function. [More on productions further below.](#productions)

- `finals`: Optional key-value Object to set Functions be executed for each symbol in sequential order. Useful for visualization. Used when calling `final()`.

- `allowClassicSyntax`: Toggles support for [classic syntax features](#classic-syntax-features) that often are more concise and mirror examples in the book better but are also less flexible.
default: `true`.

- `branchSymbols`: A String tuple of the symbols treated as branches. default: `'[]'`

- `ignoredSymbols`: A String of symbols to ignore when performing context sensitive checks. Eg. you may want to define `+-` in two-dimensional turtle-graphic L-Systems to be ignored. default: `''`.

- `forceObjects`: Toggles automatic conversion of Strings into Objects. Eg. axiom 'AB' gets converted to [{symbol: 'A'}, {symbol: 'B'}]. default: `false`.



### Example Usage

#### Basic
```.js
let myLsystem = new LSystem({
	axiom: 'F',
	productions: {
		'F': 'F-A',
		'A': 'FF++FA'
	}
})
```

#### Context sensitive (using production objects, more below)
```.js
let myLsystem = new LSystem({
	axiom: ['ABCDE'],
	productions: {
		'A': 'A+AAC',
		'B': {leftCtx: 'A', successor: 'A'},
		'C': {rightCtx: 'D', successor: 'ABCD'}
	}
})
```


#### Context sensitive (using classic ABOP-syntax)
This one is semantically equivalent to the previous example, but uses the classic syntax which is supported by default ([can be turned off](#LSystem-options)).
```.js
let myLsystem = new LSystem({
	axiom: ['ABCDE'],
	productions: {
		'A'	: 'A+AAC',
		'A<B'	: 'A',
		'C>DE'	: 'ABCD'
	}
})
```

## Productions (#productions)

You can set productions in two ways.

Multiple productions via constructor:
```.js
let myLsystem = new LSystem({
	productions: {
		[symbol]: [production],
		[symbol]: [production]
	}
})
```

Or via their setter-methods:
```.js
// Set single production
myLsystem.setProduction([symbol], [production])
{'fraction_non_alphanumeric': 0.1488214143028366, 'fraction_numerical': 0.0, 'mean_word_length': 4.448313384113167, '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': '6458665', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1543, 'n_words': 620}