<commit_before>=================
Advanced features
=================

Custom model factory
--------------------

You may provide your own implementation of the model factory used by redux-db.  This allows you to extend the functionalliy each model provides.

Here is an example of a model factory extending the default models.

.. literalinclude:: ../example/typescript.ts
    :language: javascript<commit_msg>updated docs<commit_after>=================
Advanced features
=================

Custom model factory
--------------------

You may provide your own implementation of the model factory used by redux-db.  This allows you to extend the functionalliy each model provides.

Here is an example of a model factory extending the default models.

.. literalinclude:: ../example/modelFactory.js
    :language: javascript
{'fraction_non_alphanumeric': 0.1753958587088916, 'fraction_numerical': 0.0, 'mean_word_length': 3.6704545454545454, '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': '7174401', 'n_tokens_mistral': 191, 'n_tokens_neox': 177, 'n_words': 90}