# Generate my own database

Please read [Lifecycle](/database/build-dictionary/the-building-lifecycle.md) before.

See also [Quickly add a word](/database/build-dictionary/about.md#quickly-add-a-word).

## 1 - Generate required ressources

```shell
python3 scripts/pre_generate_ressources.py
```

## 2 - Start parsing words

You need to start [api-definition](/database/build-dictionary/about.md#api-definition) in local, so our generation script can get definitions of Wiktionary.

Start `generate.py`

```shell
python3 scripts/generate.py
```

This operation take few days !

{% hint style="warning" %}
Generating a new database will erase the current one ! Make sure to save it before ! For example, make a copy of it; `cp data/remede.db data/remede.07-06-2024.db`
{% endhint %}

## 3 - Enjoy your own database !

The database situated at `data/remede.db` has been generated successfully, and you can now serve it with the API ! Congratulations !

## Troubleshooting

A generation is very long ! Sometimes it crashes or freeze... The `generate.py` script handle crashes (or in cas of freeze, the KeyboardInterrupt that you can trigger by pressing <kbd>ctrl-c</kbd> in your terminal to end the process) and saves its progression:

* `data/remede.db`; the database, not fully generated
* `data/missing-wordlist.txt`; the list of words that should have been added

To **resume the generation**, execute

```shell
python3 scripts/generate.py --resume
```

*It will automatically resume the process with the saved files*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.remede.camarm.fr/database/build-dictionary/generate-my-own-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
