Configuration:
You can customize the library behavior by changing the parameters in the class constructors:
For `TextEncoder`:
- `charset`: The character set for encoding and decoding texts. By default, it includes Latin letters, numbers, punctuation marks, spaces, and Cyrillic.
For `LibraryStructure`:
- `charset`: The character set for encoding and decoding texts.
- `max_page_content_length`: The maximum length of text on a page.
- `num_walls`: The number of walls in the library.
- `num_shelves`: The number of shelves on a wall.
- `num_volumes`: The number of volumes on a shelf.
- `num_pages`: The number of pages in a volume.
- `hexagon_base`: The base of the number system for encoding addresses.
For `BabylonLibrary`:
- `charset`: The character set for generating texts (default: Cyrillic, digits, Latin letters (uppercase and lowercase), punctuation, and space).
- `page_length`: The length of the text on each page (default: 3200 characters).
- `max_rooms`: The maximum number of rooms in the library (default: 100).
- `max_walls`: The maximum number of walls per room (default: 6).
- `max_shelves`: The maximum number of shelves per wall (default: 10).
- `max_volumes`: The maximum number of volumes per shelf (default: 10).
- `max_books`: The maximum number of books per volume (default: 100).
- `max_pages`: The maximum number of pages per book (default: 1000).
For `SmartBabylonLibrary`:
- `charset`: The character set for generating texts (default: Cyrillic, Latin letters, and digits).
- `page_length`: The length of the text on each page (default: 3200).
- `max_rooms`: The maximum number of rooms in the library (default: 100).
- `max_walls`: The maximum number of walls per room (default: 6).
- `max_shelves`: The maximum number of shelves per wall (default: 10).
- `max_volumes`: The maximum number of volumes per shelf (default: 10).
- `max_books`: The maximum number of books per volume (default: 100).
- `max_pages`: The maximum number of pages per book (default: 1000).
Project Structure
- **`smart_babylon_library.py`**: `SmartBabylonLibrary` implementation for generating realistic books with titles and pages.
- **`babylon_library.py`**: `BabylonLibrary` implementation for generating deterministic texts.
- **`library_structure.py`**: `LibraryStructure` implementation for working with library coordinates.
- **`text_encoder.py`**: `TextEncoder` implementation for encoding and decoding texts.
- **`config.py`**: Library configuration parameters.
- **`tools.py`**: Helper functions (e.g., `timeit` decorator).
- **`example.py`**: Example of library usage.