# lexpredict/lexpredict-legal-dictionary architecture

> Architecture diagram of the GitHub repository lexpredict/lexpredict-legal-dictionary, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lexpredict/lexpredict-legal-dictionary
- Repository: https://github.com/lexpredict/lexpredict-legal-dictionary

## Overview

LexPredict Legal Dictionaries is a curated collection of legal, regulatory, and other domain-specific reference data and word embeddings for NLP and document analytics. A user or application accesses the `collection` object built by `dispatcher.py` through nested path-like attributes; its `Source` wrapper can expose file contents or load CSV, Excel, and JSON data as dataframes. The README documents additional domain and multilingual collections. The source excerpt shows generic filesystem discovery and lazy file access, but not consumer integrations or per-dataset processing.

Main entry points: [`dispatcher.py`](https://github.com/lexpredict/lexpredict-legal-dictionary/blob/master/dispatcher.py) (Source collection), [`en/accounting`](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/accounting) (Accounting terms), [`en/financial`](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/financial) (Financial terms), [`en/geopolitical`](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/geopolitical) (English regulators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Data access"]
  node_accessor["Source collection<br/>[dispatcher.py]"]
end

subgraph group_english["English reference data"]
  node_accounting["Accounting terms"]
  node_financial["Financial terms"]
  node_geopolitical_en["English regulators"]
  node_legal_en["English legal terms"]
  node_medical["Medical codes"]
  node_scientific_en["Hazardous waste"]
end

subgraph group_multilingual["Multilingual reference data"]
  node_geopolitical_multi["Geopolitical data"]
  node_legal_multi["German courts"]
  node_scientific_multi["Chemical data"]
end

subgraph group_resources["Models and source assets"]
  node_embeddings["Word embeddings"]
  node_dictionary_sources["Dictionary source files"]
end

node_consumer(("Application user"))

node_consumer -->|"accesses"| node_accessor
node_accessor -->|"indexes and reads"| node_accounting
node_accessor -->|"indexes and reads"| node_financial
node_accessor -->|"indexes and reads"| node_geopolitical_en
node_accessor -->|"indexes and reads"| node_legal_en
node_accessor -->|"indexes and reads"| node_medical
node_accessor -->|"indexes and reads"| node_scientific_en
node_accessor -->|"indexes and reads"| node_geopolitical_multi
node_accessor -->|"indexes and reads"| node_legal_multi
node_accessor -->|"indexes and reads"| node_scientific_multi
node_accessor -->|"indexes"| node_embeddings
node_accessor -->|"indexes and reads"| node_dictionary_sources

click node_accessor "https://github.com/lexpredict/lexpredict-legal-dictionary/blob/master/dispatcher.py"
click node_accounting "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/accounting"
click node_financial "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/financial"
click node_geopolitical_en "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/geopolitical"
click node_legal_en "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/legal"
click node_medical "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/medical"
click node_scientific_en "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/scientific"
click node_geopolitical_multi "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/multi/geopolitical"
click node_legal_multi "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/multi/legal"
click node_scientific_multi "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/multi/scientific"
click node_embeddings "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/word2vec"
click node_dictionary_sources "https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/sources/blacks_second_edition"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_accessor,node_consumer toneBlue
class node_accounting,node_financial,node_geopolitical_en,node_legal_en,node_medical,node_scientific_en toneAmber
class node_geopolitical_multi,node_legal_multi,node_scientific_multi toneMint
class node_embeddings,node_dictionary_sources toneRose
```

## Components

### Data access

- [Source collection](https://github.com/lexpredict/lexpredict-legal-dictionary/blob/master/dispatcher.py): `dispatcher.py`

### English reference data

- [Accounting terms](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/accounting): `en/accounting`
- [Financial terms](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/financial): `en/financial`
- [English regulators](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/geopolitical): `en/geopolitical`
- [English legal terms](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/legal): `en/legal`
- [Medical codes](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/medical): `en/medical`
- [Hazardous waste](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/scientific): `en/scientific`

### Multilingual reference data

- [Geopolitical data](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/multi/geopolitical): `multi/geopolitical`
- [German courts](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/multi/legal): `multi/legal`
- [Chemical data](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/multi/scientific): `multi/scientific`

### Models and source assets

- [Word embeddings](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/en/word2vec): `en/word2vec`
- [Dictionary source files](https://github.com/lexpredict/lexpredict-legal-dictionary/tree/master/sources/blacks_second_edition): `sources/blacks_second_edition`

### Other components

- **Application user**

## Connections

- Application user → Source collection: accesses (evidence: `README.md`)
- Source collection → Accounting terms: indexes and reads (evidence: `dispatcher.py`)
- Source collection → Financial terms: indexes and reads (evidence: `dispatcher.py`)
- Source collection → English regulators: indexes and reads (evidence: `dispatcher.py`)
- Source collection → English legal terms: indexes and reads (evidence: `dispatcher.py`)
- Source collection → Medical codes: indexes and reads (evidence: `dispatcher.py`)
- Source collection → Hazardous waste: indexes and reads (evidence: `dispatcher.py`)
- Source collection → Geopolitical data: indexes and reads (evidence: `dispatcher.py`)
- Source collection → German courts: indexes and reads (evidence: `dispatcher.py`)
- Source collection → Chemical data: indexes and reads (evidence: `dispatcher.py`)
- Source collection → Word embeddings: indexes (evidence: `dispatcher.py`)
- Source collection → Dictionary source files: indexes and reads (evidence: `dispatcher.py`)
