An experimental Python tool for transforming Greek text into numerical representations
and exploring the structures that emerge from a defined letter-to-value mapping.
Overview · How It Works · Demo · Run Locally · Architecture
Lexarithmos is a command-line research application that converts Greek words, phrases, and sentences into numerical representations. It normalizes the input, applies a fixed Greek letter-to-value mapping, calculates the total value, and repeatedly reduces its digits until a single-digit result is reached.
The application can compute a phrase without changing the dataset, insert its analysis into a JSON store, or delete an existing phrase. After each storage change, a modular analysis pipeline rebuilds a second index that groups the stored values with their existing digit permutations.
| Project Type | Interface | Runtime | Storage | License |
|---|---|---|---|---|
| Experimental research tool | Command line | Python 3.10+ | JSON | MIT |
For the Greek word:
The accents are removed, the text is converted to uppercase, and the supported Greek characters are mapped to their numerical values. The total value 996 is then reduced by repeatedly summing its digits:
9 + 9 + 6 = 24
2 + 4 = 6
| Stage | Current component | Responsibility |
|---|---|---|
| 01 · Normalize | TextNormalizer |
Removes accents and punctuation, converts the input to uppercase, and separates it into words. |
| 02 · Calculate | LexarithmosCalculator |
Applies the Greek letter-to-value mapping and calculates the phrase total. |
| 03 · Reduce | DigitReducer |
Produces successive digit-sum subdivisions until a single digit remains. |
| 04 · Coordinate | Transformer |
Returns an immutable PhraseAnalysis containing the complete result. |
| 05 · Act | PhraseService |
Computes, inserts, or deletes a phrase analysis. |
| 06 · Persist | NumberRepository |
Stores phrase records in data/number_file.json. |
| 07 · Explore | AnalysisPipeline |
Runs the registered analyzers and refreshes derived research data. |
flowchart TD
A["CLI · app/"] --> B["PhraseService · services/"]
B --> C["Transformer · core/"]
C --> D["PhraseAnalysis"]
B --> E["NumberRepository · storage/"]
E --> F["number_file.json"]
E --> G["AnalysisPipeline"]
G --> H["PermutationAnalyzer"]
H --> I["permutation_file.json"]
The following output was produced by the current command-line application using compute-only mode:
Type your phrase (or 'quit' to exit):
--> πληροφορική
#############################################
# Action list #
# ----------- #
# #
# => Insert: [i] [insert] [2]. #
# => Delete: [d] [delete] [3]. #
# => Enter: Computes only. #
#############################################
-->
[Status]: Success
[Action]: compute_only
[Message]: Phrase computed successfully.
[Phrase]: πληροφορική
[Normalized Words]: ['ΠΛΗΡΟΦΟΡΙΚΗ']
[Total Value]: 996
[Subdivisions]: [996, 24, 6]| Action | Accepted input | Effect |
|---|---|---|
| Compute only | Press Enter |
Calculates and displays the analysis without modifying stored data. |
| Insert | i, insert, or 2 |
Adds the phrase under its total value and refreshes the analysis pipeline. |
| Delete | d, delete, or 3 |
Removes the phrase and refreshes the analysis pipeline. |
| Exit | quit |
Closes the application. |
Lexarithmos uses only the Python standard library; no third-party packages are required.
- Python 3.10 or newer
- Git
git clone https://github.com/3ConstArt3/Lexarithmos.git
cd Lexarithmos
python3 -m app.mainIf your environment exposes Python through the python command, use python -m app.main instead.
The current transformation API can also be used directly:
from core.transformer import Transformer
analysis = Transformer().analyze_message("πληροφορική")
print(analysis.normalized_words) # ['ΠΛΗΡΟΦΟΡΙΚΗ']
print(analysis.total_value) # 996
print(analysis.subdivisions) # [996, 24, 6]Phrase analyses are grouped by their total value in data/number_file.json. The current schema uses sub-divisions for the reduced values and key-phrases for the phrases stored under the same total.
{
"996": {
"sub-divisions": [
24,
6
],
"key-phrases": [
"πληροφορική"
]
}
}The example above is intentionally shortened to one phrase while preserving the current file structure.
Permutation analysis model
PermutationAnalyzer generates data/permutation_file.json. It groups only the digit permutations that already exist in the main number store and excludes permutations with a leading zero.
{
"699": {
"sub-divisions": [
24,
6
],
"permutations": {
"699": ["..."],
"969": ["..."],
"996": ["πληροφορική"]
}
}
}The phrase arrays are shortened here for readability.
Lexarithmos/
├── analysis/
│ ├── permutation_analyzer.py
│ └── pipeline/
│ ├── analyzer.py
│ ├── analysis_pipeline.py
│ └── default_pipeline.py
├── app/
│ ├── cli.py
│ └── main.py
├── config/
│ └── paths.py
├── core/
│ ├── actions.py
│ ├── digit_reducer.py
│ ├── exceptions.py
│ ├── lexarithmos_calculator.py
│ ├── models.py
│ ├── text_normalizer.py
│ └── transformer.py
├── data/
│ ├── number_file.json
│ └── permutation_file.json
├── services/
│ └── phrase_service.py
└── storage/
├── json_repository.py
└── number_repository.py
The architecture separates interaction, domain logic, persistence, and derived analysis. Dependencies can be injected into PhraseService, while additional research analyzers can implement the Analyzer interface and be registered with the pipeline.
- Immutable results:
PhraseAnalysisandPhraseResultare frozen data classes. - Separated responsibilities: normalization, calculation, reduction, storage, and analysis are independent components.
- Safe JSON writes: repository updates are written to a temporary file before replacing the stored dataset.
- Extensible analysis: analyzers share an abstract interface and run through a configurable pipeline.
- No external runtime dependencies: the application relies only on the Python standard library.
The next major direction is a graphical interface that will make the dataset more approachable to non-technical users. A future visual layer could expose phrase transformations and permutation groups without requiring command-line interaction.
Contributions, suggestions, and research-oriented extensions are welcome. You can open an issue or submit a pull request with a clear explanation of the proposed change.
Lexarithmos is available under the MIT License.
Designed and developed by ConstArt