MesoMath Ecosystem (Arithmetic and Metrology)#
This section documents the public API exposed directly from the root of the mesomath package.
Main Components#
BabN (Natural Sexagesimal Numbers)#
- class BabN(value: int | str | list[int] | tuple[int, int, int, int])#
Bases:
objectThis class implements a sexagesimal representation of the natural numbers and their basic arithmetic operations, especially in their “floating” version, as performed by Babylonian scribes. Hence the name.
Class attributes:#
- title:
Describe the type of object
- type title:
str
- sep:
separator for string representation (default: “:”)
- type sep:
str, (default: “:”)
- fill:
if True writes: “01.33.07” instead of “1.33.7”
- type fill:
bool, (default: False)
- rdigits:
approximate number of sexagesimal digits for some results
- type rdigits:
int, (default: 6:)
- floatmult:
If True, multiplication result is floating
- type floatmult:
bool, (default: False)
- database:
path to SQLite3 database of regular numbers providing:
regular: TEXT, regular number e.g. 01:18:43:55:12len: INTEGER, its length e.g. 5 for 01:18:43:55:12seecreateDB.pyorhamming.pyfor how to generate it- type database:
str, (default: “regular.db3”)
Instance attributes:#
- dec:
decimal version of number (ex: 405 for sexagesimal “6:45”)
- type dec:
int
- list:
list of sexagesimal digits of number (ex: [6, 45] for 405 or “6:45”)
- type list:
list
- isreg:
True if number is regular (only contains 2, 3, 5 as divisors)
- type isreg:
bool
- factors:
tuple with the powers of 2, 3, 5 and the remainder
- type factors:
tuple
jccsvq fecit, 2005. Public domain.
Operators#
This class overloads arithmetic and logical operators allowing arithmetic operations and comparisons to be performed between members of the class and externally with integers. Comparing with any other object type will raise
NotImplementedError.Initialize a new Babylonian number (BabN).
This constructor acts as a robust gateway for sexagesimal data. It normalizes input values, enforces the non-negative constraint of Babylonian mathematics, and protects against improper metrological mixing.
- param value:
The source data for the number. Supported formats:
int | float: Absolute integer value.
str: Sexagesimal digits separated by non-numeric characters (e.g., “1:20”, “1.20”).
list: Coefficients of the sexagesimal polynomial. Values > 59 are automatically normalized (carry-over).
tuple: A 4-element factor tuple (i, j, k, x) representing \(2^i \cdot 3^j \cdot 5^k \cdot x\).
- type value:
int | str | list | tuple
- raises ValueError:
If the input string contains no digits, a tuple does not have 4 elements, or factors are invalid.
- raises TypeError:
If an unsupported type is passed, or if a metrological unit (e.g., Blen, Bwei) is found inside a list.
Note
Normalization Logic: If a list is provided as
[1, 125], it is treated as \(1 \cdot 60^1 + 125 \cdot 60^0 = 185\), which normalizes to[3, 5](3:05).Warning
To maintain historical rigor, all negative inputs are converted to their absolute value.
- classmethod create_new(data: int | str | list[int] | tuple[int, int, int, int]) BabN#
Class method that returns a new instance.
- Parameters:
data (_type_) – _description_
- Returns:
resultant object
- Return type:
“BabN”
- static _calculate_factors(n: int) tuple[int, int, int, int]#
Obtains \(i, j, k, x\) such that \(2^i \cdot 3^j \cdot 5^k \cdot x = n\)
- Parameters:
n (int) – decimal integer
- Returns:
tuple (i, j, k, x)
- Return type:
tuple[int, int, int, int]
- static _to_decimal(s_list: list[int]) int#
Convert a sexagesimal list to a decimal integer (BigInt).
- Parameters:
s_list (list[int]) – list of sexagesimal digits
- Returns:
equivalent decimal integer
- Return type:
int
- static _to_sexagesimal(n: int) list[int]#
Convert a decimal integer to its sexagesimal list representation.
- Parameters:
n (int) – decimal integer to convert
- Returns:
resulting sexagesimal list
- Return type:
list[int]
- static genDB(dbname: str) None#
Generates a sqlite3 database of regular numbers up to 20 sexagesimal digits
- Dbname:
database path and name
- __init__(value: int | str | list[int] | tuple[int, int, int, int])#
Initialize a new Babylonian number (BabN).
This constructor acts as a robust gateway for sexagesimal data. It normalizes input values, enforces the non-negative constraint of Babylonian mathematics, and protects against improper metrological mixing.
- Parameters:
value (int | str | list | tuple) –
The source data for the number. Supported formats:
int | float: Absolute integer value.
str: Sexagesimal digits separated by non-numeric characters (e.g., “1:20”, “1.20”).
list: Coefficients of the sexagesimal polynomial. Values > 59 are automatically normalized (carry-over).
tuple: A 4-element factor tuple (i, j, k, x) representing \(2^i \cdot 3^j \cdot 5^k \cdot x\).
- Raises:
ValueError – If the input string contains no digits, a tuple does not have 4 elements, or factors are invalid.
TypeError – If an unsupported type is passed, or if a metrological unit (e.g., Blen, Bwei) is found inside a list.
Note
Normalization Logic: If a list is provided as
[1, 125], it is treated as \(1 \cdot 60^1 + 125 \cdot 60^0 = 185\), which normalizes to[3, 5](3:05).Warning
To maintain historical rigor, all negative inputs are converted to their absolute value.
- _ensure_babn(other: object) BabN#
Internal helper to normalize types before operating.
- Parameters:
other (object) – operand
- Returns:
BabN object
- Return type:
- cbrt() BabN#
Returns BabN object with approximate floating cube root
- Returns:
approximate floating cube root
- Return type:
- cuneiform(alter: bool = False, stroke: bool = False) str#
Cuneiform version of sexagesimal number
Requires Noto Sans Cuneiform font or similar to be present in your system. This method uses U+2009 Thin Space Unicode Characters
- Parameters:
obj (Any) – BabN object or string to be converted
alter (bool, optional) – alternate version of some signs, defaults to False
stroke (bool, optional) – strike out empty space (sexagesimal digit zero), defaults to False
- Returns:
cuneiform string
- Return type:
str
- dist(n: str | int | _SpecialForm) int#
Estimates a certain “pseudo-distance” between two sexagesimal numbers.
The objective is, given a non-regular number, to select the regular number that is closest to it from a list. Since these are floating-point numbers, this pseudo-distance must be based on the similarity of the most significant sexagesimal digits, so that 7 is “close” to 6:59:54:14:24 (decimals 7 and 90699264).
- Parameters:
n (str | int | type) – may be an integer, formated string (ex: “1:2:3”), a list (ex., [1, 12, 23]) or another BabN object.
- Returns:
pseudo-distance
- Return type:
int
- explain() None#
Explains number; print out basic information about the object.
- f() Self#
Returns BabN object with the floating part of the number (mantissa), i.e., removes any trailing sexagesimal zero, ex.: 4:42:0:0 -> 4:42
- float() Self#
Returns BabN object with the floating part of the number (mantissa), i.e., removes any trailing sexagesimal zero, ex.: 4:42:0:0 -> 4:42
- head(d: int = 1) BabN#
Returns the BabN object with the first d digits at most from self
- Parameters:
d (int, optional) – Number of digits to return, defaults to 1
- Returns:
d most significant sexagesimal digits of self
- Return type:
- inv(digits: int = 4) Self | None#
Returns BabN object with approximate inverse of the number, i.e., a * a.inv() is approximately a power of 60
- Parameters:
digits (int, optional) – the intended number of digits to return, defaults to 4
- Returns:
_description_
- Return type:
“BabN” | None
- len() int#
Returns the number of sexagesimal digits of the number as int
- Returns:
number of sexagesimal digits of the number as int
- Return type:
int
- multable(pral: bool = True, sep: str = ':', fill: bool = False, cuneiform: bool = False, stroke: bool = False, floating: bool = False, indices: List[int] = None, echo: bool = True) List[str] | None#
Displays the multiplication table for the current number.
Following Babylonian tradition, the table includes the ‘principal’ multipliers (1 to 20, then 30, 40, 50) or the full range (1 to 59).
- Parameters:
pral (bool) – If True, prints principal numbers (1-20, 30, 40, 50). If False, prints 1 to 59. Defaults to True.
sep (str) – Separator for sexagesimal digits. Defaults to “:”.
fill (bool) – If True, adds leading zeros to sexagesimal digits <= 9.
cuneiform (bool) – If True, outputs the table in Unicode Cuneiform.
stroke (bool) – If True, strikes out empty spaces (zeroes) in cuneiform.
floating (bool) – If True, results are treated as sexagesimal floating point.
indices (list[ints]) – print table only for these values. Defaults to None.
echo (bool) – if False return list of marldown lines instead of printing them. Defaults to True.
- Returns:
List of strings with markdown table
- Return type:
List[str] | None
- multable_nb(*arg, **kwargs)#
Displays the multiplication table in a Jupyter Notebook using Markdown.
- Parameters:
arg – Positional arguments for multable.
kwargs – Keyword arguments for multable.
- rec() Self | None#
Returns the reciprocal of the BabN object using the factorization method.
- round(d: int) BabN#
Returns BabN object rounded to d sexagesimal digits
- Parameters:
d (int) – Number of digits to return
- Returns:
number rounded to d sexagesimal digits
- Return type:
- searchreg(minn: str | int, maxn: str | int, limdigits: int = 6, prt: bool = False) BabN#
Search database for regulars between sexagesimals minn y maxn. Returns BabN object with the closest regular found.
- Parameters:
minn (str | int) – and maxn: must be sexagesimal strings using “:” separator
maxn (str | int) – and maxn: must be sexagesimal strings using “:” separator
limdigits (int, optional) – max regular digits number, defaults to 6
prt (bool, optional) – print list of found regulars, defaults to False
- Returns:
closest regular found as BabN object
- Return type:
- sqrt() BabN#
Returns BabN object with approximate floating square root
- Returns:
approximate floating square root
- Return type:
- tail(d: int = 1) BabN#
Returns the BabN object with the last d digits of itself at most
- Parameters:
d (int, optional) – Number of digits to return, defaults to 1
- Returns:
d less significant sexagesimal digits of self
- Return type:
- to_cunei(alter: bool = False, stroke: bool = False) str#
Cuneiform version of sexagesimal number
Requires Noto Sans Cuneiform font or similar to be present in your system. This method uses U+2009 Thin Space Unicode Characters
- Parameters:
obj (Any) – BabN object or string to be converted
alter (bool, optional) – alternate version of some signs, defaults to False
stroke (bool, optional) – strike out empty space (sexagesimal digit zero), defaults to False
- Returns:
cuneiform string
- Return type:
str
- trim(d: int) BabN#
Returns BabN object corresponding to the first d sexagesimal digits
- Parameters:
d (int) – Number of digits to retain
- Returns:
_description_
- Return type:
- property dec#
Getter
- property factors: tuple[int, int, int, int]#
Getter. Calculate the factors only when requested (Lazy).
- Returns:
i, j, k, x such that self.dec = 2^i * 3^j * 5^k * x
- Return type:
tuple[int, int, int, int]
- property isreg: bool#
Getter (Lazy)
- property list#
Getter
BabF (Sexagesimal Fractions)#
- class BabF(p: int | str | list[int] | tuple[int, int, int, int], q: int | str | list[int] | tuple[int, int, int, int] = None)#
Bases:
objectClass for sexagesimal representation of fractions and their basic arithmetic operations.
Class constructor
- Parameters:
- classmethod repeated(repeat: int | str | list[int] | tuple[int, int, int, int]) object#
Converts repeating digits in sexagesimal notation to fraction.
- Parameters:
repeat (int | str | list[int] | tuple[int, int, int, int]) – sexagesimal repeating digits
- Returns:
BabF object with the repeating digits
- Return type:
object
- __init__(p: int | str | list[int] | tuple[int, int, int, int], q: int | str | list[int] | tuple[int, int, int, int] = None)#
Class constructor
- _check_operand(other)#
Validate that the operand is not a float before operating.
- expand(max_digits: int = 6) str#
Return the sexagesimal expansion of the fraction using max_digits and
cls.SEPas “sexagesimal point” (default@).- Parameters:
max_digits (int, optional) – Number of sexagesimal digits to use, defaults to 6
- Returns:
String with the sexagesimal expansion of the fraction
- Return type:
str
- to_cunei(ndigits: int = 6, alter: bool = False, stroke: bool = False) str#
Cuneiform version of sexagesimal number
Requires Noto Sans Cuneiform font or similar to be present in your system. This method uses U+2009 Thin Space Unicode Characters
- Parameters:
ndigits (int, optional) – Number of sexagesimal digits to use, defaults to 6
obj (Any) – BabN object or string to be converted
alter (bool, optional) – alternate version of some signs, defaults to False
stroke (bool, optional) – strike out empty space (sexagesimal digit zero), defaults to False
- Returns:
cuneiform string
- Return type:
str
- property as_dec_fraction: str#
Returns the object as fraction of decimal integers
- Returns:
String with the fraction of decimal integers
- Return type:
str
- property as_float: float#
Returns the decimal value of the fraction as a float.
- Returns:
Decimal value of the fraction
- Return type:
float
- property p: object#
Getter
- Returns:
Numerator of the fraction
- Return type:
BabN object
- property q: object#
Getter
- Returns:
Denominator of the fraction
- Return type:
BabN object
- property rec: object#
Returns BabF object with the reciprocal of self
- Returns:
BabF object with the reciprocal of self
- Return type:
BabF object
- property simplified: object#
Return BabF object with the fraction in lowest terms.
- Returns:
BabF object with the simplified fraction.
- Return type:
BabF object
Metrology Units (NPVs)#
- class Blen(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Old Babylonian Period length units
danna <-30- UŠ <-60- ninda <-12- kuš3 <-30- šu-si
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class Bsur(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Old Babylonian Period surface units:
GAN2 <-100- sar <-60- gin2 <-180- še
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class Bvol(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Old Babylonian Period volume units:
GAN2 <-100- sar <-60- gin2 <-180- še
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- bricks(nalb: float = 1.0) Bbri#
Returns the volume in number of bricks equivalent based on their “Nalbanum.” 720 for 1 sar volume if nalb is 1.
- Parameters:
nalb (float, optional) – nalbanum in decimal e.g. 7.20 for type 2 bricks, defaults to 1.0
- Returns:
volume in bricks equivalent
- Return type:
“Bbri”
Brick type
Nalb. (dec.)
Nalb. (sex.)
1
9.00
9
1a
8.33
8:20
2
7.20
7:12
3
5.40
5:24
4
5.00
5
5
4.80
4:48
7
3.33
3:20
8
2.70
2:42
9
2.25
2:15
10
1.875
1:52:30
11
1.20
1:12
12
1.00
1
- cap()#
Convert volume to capacity measurement
- class Bcap(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Old Babylonian Period capacity units:
gur <-5- bariga <-6- ban2 <-10- sila3 <-60- gin2 <-180- še
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class Bwei(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Old Babylonian Period weight units:
gu2 <-60- ma-na <-60- gin2 <-180- še
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class Bbri(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Old Babylonian Period counting bricks in “sar-b” units (720 bricks):
GAN2 <-100- sar <-60- gin2 <-180- še
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- vol(nalb: float = 1.0) Bvol#
Returns the volume corresponding to a number of bricks based on their Nalbanum. 1 sar volume for 720 bricks if nalb is 1
- Parameters:
nalb (float, optional) – nalbanum in decimal e.g. 7.20 for type 2 bricks, defaults to 1.0
- Returns:
equivalent volume
- Return type:
Brick type
Nalb. (dec.)
Nalb. (sex.)
1
9.00
9
1a
8.33
8:20
2
7.20
7:12
3
5.40
5:24
4
5.00
5
5
4.80
4:48
7
3.33
3:20
8
2.70
2:42
9
2.25
2:15
10
1.875
1:52:30
11
1.20
1:12
12
1.00
1
- class BsyC(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Babylonian System-C (Common) numeration
u <-10- diš
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class BsyG(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Babylonian System-G (GAN2) numeration
šar2-gal <-6- šar’u <-10- šar2 <-6- bur’u <-10- bur3 <-3- eše3 <-6- iku
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class BsyK(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Babylonian System-SKL (Sumerian King List) numeration
šar2-gal <-6- šar’u <-10- šar2 <-6- geš’u <-10- geš <-6- u <-10- diš
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
- class BsyS(x: int | str | float)#
This class implement Non-Place-Value System arithmetic for Babylonian System-S (Sexagesimal) numeration
šar2-gal <-6- šar’u <-10- šar2 <-6- geš’u <-10- geš <-6- u <-10- aš
Class constructor
- Parameters:
x (int | float | str) – The parameter n can be an integer (sign is ignored) or a properly formatted string representing the value. See the tutorial
Internal Support Submodules#
If you need to extend the behavior or work with low-level parsers:
Metrological Expresion Parser#
parser/interpreter.py This module implements the Babylonian metrological expression interpreter based on PEG grammars.
The interpreter must be able to accept all 75 types of MesoMath output expressions so that they can be fed back as inputs.
- class MesoInterpreter(metrological_class: Any, sexagesimal_system: Any)#
Bases:
NodeVisitorMain interpreter for Mesopotamian metrological calculations. Coordinates between a metrological class (Length, Volume, etc.) and a sexagesimal system to resolve complex input strings.
Class constructor
- Parameters:
metrological_class – The main class (Blen, Bvol, etc.) providing unit names and factors.
sexagesimal_system – The sexagesimal system (BsyS and BsyG) for internal resolution.
- generic_visit(node, visited_children) Any#
Default fallback for node visitors.
- parse(text: str) float#
Normalizes the input text and parses it against the MESO_GRAMMAR. Returns the total accumulated value.
- visit_babn(node, visited_children) int#
Resolves BabN positional notation (e.g., 2:53) to its decimal value.
- visit_entry(node, visited_children) float#
Sums all individual measurements found in the string.
- visit_fractional(node, visited_children) float#
Maps fraction strings to their floating-point equivalents.
- visit_integer(node, visited_children) int#
Converts integer text to int.
- visit_measure(node, visited_children) int#
Resolves the final value of a measure by checking unit priorities: 1. Current metrological class (e.g., Blen factors). 2. Sexagesimal system associated with the class.
- visit_plus_frac(node, visited_children) float#
Returns the value of a fraction following a ‘+’ sign.
- visit_sexag(node, visited_children) float#
Handles parenthetical sexagesimal expressions by delegating to the SexagInterpreter.
- visit_unit_name(node, visited_children) str#
Returns the raw unit name.
- visit_value(node, visited_children) float#
Processes numerical values, including optional fractions (e.g., 5 + 1/2).
- class SexagInterpreter(sexsys: Any)#
Bases:
NodeVisitorInterpreter for the contents of sexagesimal parenthetical expressions. It resolves units based on a specific sexagesimal system (e.g., BsyS, BsyG).
Class constructor
- Parameters:
sexsys (Any) – sexagesimal system S or G
- generic_visit(node, visited_children)#
Default visitor for nodes without a specific visit method.
- visit_entry(node, visited_children)#
Sums all processed measurements within the parentheses.
- visit_measure(node, visited_children)#
Processes a single measurement unit and multiplies by its factor.
- visit_unit_name(node, visited_children)#
Returns the raw unit name string.
- visit_value(node, visited_children)#
Converts numerical text to float.
- MESO_GRAMMAR = '\n entry = (measure space)*\n measure = value space unit_name\n value = (sexag plus_frac?) / (babn plus_frac?) / (integer plus_frac?) / fractional\n \n sexag = "(" ~"[^)]+" ")"\n babn = ~r"[0-9]+(:[0-9]+)+"\n \n plus_frac = "+" fractional\n fractional = ~r"[1-5]/6" / ~"1/2" / ~"1/3" / ~"2/3" / ~"5/6"\n \n integer = ~r"[0-9]+"\n unit_name = ~r"[a-z1-3šś\\\'\\-]+"\n space = ~r"\\s*"\n'#
Main grammar used to parse complex metrological strings
- SEXAG_GRAMMAR = '\n entry = (measure space)*\n measure = value space unit_name\n value = integer / fractional\n integer = ~r"[0-9]+"\n fractional = ~r"[1235]/6" / ~"1/2" / ~"1/3"\n unit_name = ~r"[a-z1-3\\-]+"\n space = ~r"\\s*"\n'#
Simplified grammar used specifically for Systems S and G
Generation of Hamming numbers (Regular numbers).#
This module provides functions to generate Hamming numbers, also known as Regular numbers. These are numbers whose prime factors are limited to 2, 3, and 5.
with
The implementation uses the cyclic generator (method #2) adapted from Rosetta Code. The Rosetta Code algorithm is a very elegant and functional implementation (lazy evaluation style), but its brevity makes it cryptic. It uses generators and the tee function from itertools to create self-feeding data streams, emulating a recursive data structure.
Output Formats#
The module can generate Hamming numbers in three formats:
Database Generation#
To create the regular.db3 database required by the BabN class,
you can pipe the script output directly into the sqlite3 utility:
$ python3 hamming.py | sqlite3 regular.db3
Note
All output is directed to stdout by default.
- Author:
jccsvq
- Date:
2025
- genCSV(maxn: int, sep: str = ',') None#
Generates csv table of regular numbers and reciprocals
genCSV(80000) takes a few seconds! Writes to stdin.
- Parameters:
maxn (int) – write the table up to this value
sep (str, optional) – csv field separator, defaults to “,”
- genSQL(maxn: int) None#
Generates list or regular numbers in sqlite3 SQL format
- Parameters:
maxn (int) – decimal int, write the table up to this value
- hamming(a: int, b: int | None = None) list[int]#
Generates a list of Hamming’s numbers from a to b if b is not None, otherwise return a list containig the a-th hamming number only
- Parameters:
a (int) – starting number
b (int | None, optional) – list ending number, defaults to None
- Returns:
list of Hamming’s numbers
- Return type:
list[int]
Cuneiform Glyphs#
This module contains the cuneiform glyphs necessary for writing metrological measurements from the Old Babylonian period. You will need to have a TrueType font such as Noto Sans Cuneiform or similar installed on your system for proper display.
- DETERM = {'dug': '𒂁', 'gi': '𒄀', 'ku3': '𒆬'}#
Determinatives
- MAP_ADMIN = {'ba_til': '𒁀\u2009𒌀', 'dub': '𒁾', 'dub-sar': '𒁾\u2009𒊬', 'ib2_tag4': '𒅁\u2009𒋳', 'iti': '𒌗', 'la-ia': ' 𒇲\u2009𒉌', 'mu': '𒈬', 'mu-kux': '𒈬\u2009𒁺', 'mu_sid_bi': '𒈬\u2009𒋃\u2009𒁉', 'nig-ka': '𒃻\u2009𒅗', 'nu_til': '𒉡\u2009𒌀', 'sa10': '𒌓', 'su_ningin_gal': '𒋗\u2009𒆸\u2009𒃲', 'su_ti_a': '𒋗\u2009𒋾\u2009𒀀', 'zi-ga': ' 𒍣\u2009𒂵'}#
For colophons
- MAP_ARITHMOGRAMS = {'ash': ['𒀸', '𒐀', '𒐁', '𒐂', '𒐃', '𒐄', '𒐅', '𒐆', '𒐇'], 'dis': ['𒁹', '𒐖', '𒐈', '𒐉', '𒐊', '𒐋', '𒐌', '𒐍', '𒐎'], 'ges': ['𒐕', '𒐖', '𒐗', '𒐘', '𒐙', '𒐚', '𒐛', '𒐜', '𒐝'], 'gesu': ['𒐞', '𒐟', '𒐠', '𒐡', '𒐢'], 'sar2': ['𒊹', '𒐣', '𒐤', '𒐦', '𒐧', '𒐨', '𒐩', '𒐪', '𒐫'], 'saru': ['𒐬', '𒐭', '𒐮', '𒐰', '𒐱'], 'u': ['𒌋', '𒎙', '𒌍', '𒐏', '𒐐', '𒐑', '𒐒', '𒐓', '𒐔']}#
Dictionary for quick access by unit/system name
- MAP_UNITS = {'BARIGA': 'ሪB', 'DANNA': 'ሚ1ሆD', 'GIN2': 'ሒF', 'GUR': '𒄥', 'KUŠ3': 'ሳ3', 'MA-NA': '𒈠\u2009𒈾', 'SILA3': '𒋡', 'ŠU-SI': 'ር7ራ0'}#
Unit dictionary
- MAP_UNIT_LOGOGRAMS = {'as': '𒀸', 'ban': '𒑏', 'bariga': '𒉿', 'bur': '𒌋', 'buru': '𒐴', 'danna': '𒆜\u2009𒁍', 'dis': '𒁹', 'ese': '𒑘', 'gan': '𒃷', 'ges': '𒐕', 'gesu': '𒐞', 'gin': '𒂆', 'gu': '𒄘', 'gur': '𒄥', 'iku': '𒀸', 'kus': '𒌑', 'kush3': '𒌑', 'mana': '𒈠\u2009𒈾', 'ninda': '𒃻', 'sar': '𒊬', 'sargal': '𒊹', 'saru': '𒐬', 'se': '𒊺', 'sila': '𒋡', 'susi': '𒋗\u2009𒋛', 'u': '𒌋', 'us': '𒍑'}#
for _MesoM.schema() use
- UNIT_LOGOGRAMS = {'as': '𒀸', 'ges': '𒐕', 'gesu': '𒐞', 'kush3': '𒌑', 'ninda': '𒃻', 'sar': '𒊬', 'sargal': '𒊹', 'saru': '𒐬'}#
Mapping of internal names to Unicode logograms
- fglyphdict = {'1/2': '𒈦', '1/3': '𒑚', '1/6': '𒑡', '2/3': '𒑛', '5/6': '𒑜'}#
Klasmatograms
- l_as = ['𒀸', '𒐀', '𒐁', '𒐂', '𒐃', '𒐄', '𒐅', '𒐆', '𒐇']#
aš
- l_bur3 = ['𒌋', '𒎙', '𒌍', '𒐏', '𒐐', '𒐑', '𒐒', '𒐓', '𒐔']#
bur3
- l_buru = ['𒐴', '𒐵', '𒐶', '𒐸', '𒐹']#
buru
- l_dis = ['𒁹', '𒐖', '𒐈', '𒐉', '𒐊', '𒐋', '𒐌', '𒐍', '𒐎']#
diš
- l_ese3 = ['𒑘', '𒑙']#
eše3
- l_ges = ['𒐕', '𒐖', '𒐗', '𒐘', '𒐙', '𒐚', '𒐛', '𒐜', '𒐝']#
geš
- l_gesu = ['𒐞', '𒐟', '𒐠', '𒐡', '𒐢']#
gešu
- l_iku = ['𒀸', '𒐀', '𒐁', '𒐂', '𒐃']#
iku
- l_sar2 = ['𒊹', '𒐣', '𒐤', '𒐦', '𒐧', '𒐨', '𒐩', '𒐪', '𒐫']#
šar2
- l_sar2_gal = ['𒐲']#
šar2-gal
- l_saru = ['𒐬', '𒐭', '𒐮', '𒐰', '𒐱']#
šaru
- l_u = ['𒌋', '𒎙', '𒌍', '𒐏', '𒐐', '𒐑', '𒐒', '𒐓', '𒐔']#
u
- subsdict = {'a_ra2': '𒀀\u2009𒁺', 'a_sa': '𒀀\u2009𒊮', 'bur': '𒌋', 'da': '𒁕', 'dagal': '𒂼', 'er3': '𒀴', 'esir': '𒀀\u2009𒂍', 'ga_ar3': '𒂵\u2009𒄯', 'gada': '𒃰', 'gam': '𒃵', 'geme2': '𒊩', 'ges': '𒄑', 'ges_tin': '𒃾', 'gid': '𒁍', 'gu4': '𒄞', 'i3_gis': '𒉌\u2009𒄑', 'i3_nun': '𒉌\u2009𒉣', 'igi_nu': '𒅆\u2009𒉡', 'igi_nu_du8': '𒅆\u2009𒉡\u2009𒂃', 'kas': '𒁉', 'ki_la2': '𒆠\u2009𒆷', 'kiri6': '𒊬', 'ku3_sig17': '𒆬\u2009𒄀', 'ku_babbar': '𒆬\u2009𒌓', 'lu2': '𒇽', 'na4': '𒉌', 'sag': '𒊕', 'sag_dagal': '𒊕\u2009𒂼', 'sahar': '𒅖', 'se': '𒊺', 'sig4': '𒋞', 'siki': '𒋠', 'siki_gi': '𒋠\u2009𒄀', 'sukud': '𒊩𒆪', 'udu': '𒇻', 'urudu': '𒍏', 'us': '𒍑', 'ziz2': '𒀾', 'zu2_lum': '𒍪\u2009𒈝'}#
Substance Symbols and others:
- translit_dict = {'1(aš)': '𒀸', '1(ban2)': '𒑏', '1(barig)': '𒁹', '1(bur3)': '𒌋', '1(bur’u)': '𒐴', '1(diš)': '𒁹', '1(eše3)': '𒑘', '1(geš2)': '𒐕', '1(geš’u)': '𒐞', '1(iku)': '𒀸', '1(u)': '𒌋', '1(ubu)': '𒀹', '1(šar2)': '𒊹', '1(šargal)gal': '𒊹\u2009𒃲', '1(šar’u)': '𒐬', '1/2': '𒈦', '1/3': '𒑚', '2(aš)': '𒐀', '2(ban2)': '𒑐', '2(barig)': '𒑖', '2(bur3)': '𒎙', '2(bur’u)': '𒐵', '2(diš)': '𒐖', '2(eše3)': '𒑙', '2(geš2)': '𒐖', '2(geš’u)': '𒐟', '2(iku)': '𒐀', '2(u)': '𒎙', '2(šar2)': '𒐣', '2(šar’u)': '𒐭', '2/3': '𒑛', '3(aš)': '𒐁', '3(ban2)': '𒑑', '3(barig)': '𒑗', '3(bur3)': '𒌍', '3(bur’u)': '𒐶', '3(diš)': '𒐈', '3(geš2)': '𒐗', '3(geš’u)': '𒐠', '3(iku)': '𒐁', '3(u)': '𒌍', '3(šar2)': '𒐤', '3(šar’u)': '𒐮', '4(aš)': '𒐂', '4(ban2)': '𒑒', '4(barig)': '𒐉', '4(bur3)': '𒐏', '4(bur’u)': '𒐸', '4(diš)': '𒐉', '4(diš)gal2': '𒐉\u2009𒅅', '4(geš2)': '𒐘', '4(geš’u)': '𒐡', '4(iku)': '𒐂', '4(u)': '𒐏', '4(šar2)': '𒐦', '4(šar’u)': '𒐰', '5(aš)': '𒐃', '5(ban2)': '𒑔', '5(bur3)': '𒐐', '5(bur’u)': '𒐹', '5(diš)': '𒐊', '5(geš2)': '𒐙', '5(geš’u)': '𒐢', '5(iku)': '𒐃', '5(u)': '𒐐', '5(šar2)': '𒐧', '5(šar’u)': '𒐱', '5/6': '𒑜', '6(aš)': '𒐄', '6(bur3)': '𒐑', '6(diš)': '𒐋', '6(diš)gal2': '𒐋\u2009𒅅', '6(geš2)': '𒐚', '6(šar2)': '𒐨', '7(aš)': '𒐅', '7(bur3)': '𒐒', '7(diš)': '𒐌', '7(geš2)': '𒐛', '7(šar2)': '𒐩', '8(aš)': '𒐆', '8(bur3)': '𒐓', '8(diš)': '𒐍', '8(geš2)': '𒐜', '8(šar2)': '𒐪', '9(aš)': '𒐇', '9(bur3)': '𒐔', '9(diš)': '𒐎', '9(geš2)': '𒐝', '9(šar2)': '𒐫', 'GAN2': '𒃷', 'UŠ': '𒍑', 'a-ša3': '𒀀\u2009𒊮', 'danna': '𒆜\u2009𒁍', 'gal2': '𒅅', 'gin2': '𒂆', 'gu2': '𒄘', 'gur': '𒄥', 'igi': '𒅆', 'ku3-babbar': '𒆬\u2009𒌓', 'kuš3': '𒌑', 'ma-na': '𒈠\u2009𒈾', 'ninda': '𒃻', 'sar': '𒊬', 'sila3': '𒋡', 'še': '𒊺', 'šu-nu-tag': '𒋗\u2009𒉡\u2009𒋳', 'šu-si': '𒋗\u2009𒋛'}#
Transliteration to cuneiform dictionary
- unit_dict = {'ban': ['𒑏', '𒑐', '𒑑', '𒑒', '𒑔'], 'bariga': ['𒁹', '𒑖', '𒑗', '𒐉'], 'danna': '𒆜\u2009𒁍', 'gan': '𒃷', 'gin': '𒂆', 'gu': '𒄘', 'gur': '𒄥', 'kus': '𒌑', 'mana': '𒈠\u2009𒈾', 'ninda': '𒃻', 'sar': '𒊬', 'se': '𒊺', 'sila': '𒋡', 'susi': '𒋗\u2009𒋛', 'us': '𒍑'}#
Metrograms: