Skip to main content

Mnemonic tools

Project description

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

Project details


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.5.tar.gz (13.0 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.5-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hm-0.0.5.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.5.tar.gz
Algorithm Hash digest
SHA256 ab1417f825c022f1e586620b6e7ee9c4e839edb8943f23308a893b88fd90eb35
MD5 ea0e0cddc55521e0c5f739ea11c48ccc
BLAKE2b-256 246001ec80276aa489e329ea24bc6a45d0a3dcdd1feeeb4a825cdea78007435e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hm-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0295f7b0e58a1c00117b76090470d9f50c473f9d5efced6113521b674cec42f4
MD5 295a59717971f18839e03b7e2d81dd36
BLAKE2b-256 e7158ba3b515dcdcb62582682b915bef9da2c05d8197a5614b6ada69bebfb4e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page