Skip to main content

hm

Mnemonic tools

To install: pip install hm

Mnemonic Major System

The major system is a mnemonic technique used to aid in memorizing numbers.

It works as follows:

>>> from hm import MajorSystem
>>> m = MajorSystem()

The "Mnemonic Major System" (https://en.wikipedia.org/wiki/Mnemonic_major_system) assigns a set of similar phonemes to each digit:

>>> assert m.phones_for_num == {
...     0: {'S', 'Z'},
...     1: {'D', 'DH', 'T', 'TH'},
...     2: {'N'},
...     3: {'M'},
...     4: {'R'},
...     5: {'L'},
...     6: {'CH', 'JH', 'SH'},
...     7: {'G', 'K'},
...     8: {'F', 'V'},
...     9: {'B', 'P'}
... }

As a consequence these phonemes are mapped to numbers:

>>> assert m.num_of_phone == {
...     'B': 9,
...     'CH': 6,
...     'D': 1,
...     'DH': 1,
...     'F': 8,
...     'G': 7,
...     'JH': 6,
...     'K': 7,
...     'L': 5,
...     'M': 3,
...     'N': 2,
...     'P': 9,
...     'R': 4,
...     'S': 0,
...     'SH': 6,
...     'T': 1,
...     'TH': 1,
...     'V': 8,
...     'Z': 0
... }

Any sentence has a corresponding phoneme sequence:

>>> m.term_to_phones('wild cat')
['W', 'AY1', 'L', 'D', 'K', 'AE1', 'T']

The system doesn't contain all phonemes; only some of the consonant phonemes. So if we only keep those phonemes that the system covers, we get:

>>> m.term_to_mst_sequence('wild cat')
['L', 'D', 'K', 'T']

Which corresponds to a number.

>>> m.term_to_nums('wild cat')
[5, 1, 7, 1]

But really, the system is used to be able to create words (therefore images) that correspond to a sequence of numbers, so that one can remember them:

>>> m.terms_of_numstr['3214']  # doctest: +NORMALIZE_WHITESPACE
['hammontree', 'mahindra', 'manteer', 'mantra', 'mentor', 'minteer', 'mondry',
'monetary', 'monteiro', 'monterey', 'montero', 'monterrey', 'montrouis',
'montroy', 'montuori', 'omohundro']

Metadata

Release files for hm 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hm 0.0.7
File Size Uploaded
hm-0.0.7.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hm 0.0.7
File Interpreter ABI Platform
hm-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / hm-0.0.7.tar.gz

Download URL hm-0.0.7.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f75fc01c8e17d5e5f13f27c03d194f675546cafcaeaf15b81f7c4b811f1929f4
BLAKE2b-256 checksum
How to use checksums
9a0da3aff3a132475f1182ead2cdec623f277ab76c2c342c03b6420c64999f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hm-0.0.7-py3-none-any.whl

Download URL hm-0.0.7-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52e8db3ab87050d67176fa26685f4b28b44ec9e488d4558f3f25c53b46cbdba5
BLAKE2b-256 checksum
How to use checksums
81392a008a5001508b45a774d49e88384f562ea223a3fdd73f2765382707bda6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page