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']

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hm-0.0.6.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hm-0.0.6-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file hm-0.0.6.tar.gz.

File metadata

  • Download URL: hm-0.0.6.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}

File hashes

Hashes for hm-0.0.6.tar.gz
Algorithm Hash digest
SHA256 02a75f907b1e0e748395d396ebe400828716e4f0bb82d120d3a726ff28e810a0
MD5 92f659f6db4be67b435ffcf922554b05
BLAKE2b-256 ac773476ad3729fb2503070591065ea37cf8bf81d2aaf26b3154e9195ba5ded8

See more details on using hashes here.

File details

Details for the file hm-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: hm-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}

File hashes

Hashes for hm-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 52f7825a6a4028b064ef5779f74ee6d7f78d2d130590684cb612af24652ec7da
MD5 60c7157bc057256229154e95623d87de
BLAKE2b-256 cf54f905e3e08374d9cfbd33c747b7675d191b05ebb5bf4086df9ca3d7954e45

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 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