Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ENDrain committed Apr 18, 2021
2 parents f65f63a + 37711b4 commit 0cd336f
Show file tree
Hide file tree
Showing 7 changed files with 305 additions and 183 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.2.0

- Added: Now supports reading/writing in "plain" style
- Added: Flags to specify Arabic to CU conversion mode (default to "delimeter" style)
- Added: Flag to omit "titlo"

## 1.1.1

Cleanup
Expand Down
87 changes: 55 additions & 32 deletions INTRODUCTION.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,76 @@
# NUMBERS IN CHURCH SLAVONIC SCRIPT
# CYRILLIC NUMERAL SYSTEM

## 1. Numerals
Church numeral system (*further CU*) has individual letters assigned to represent numbers from 1 to 9 in registries from digits to hundreds, for a total of 27 numerals. There's no zero numeral.

Church Slavonic script (*further CU*) has individual numerals to represent numbers from 1 to 9, each round ten and each round hundred, for a total of 27 numerals. There's no zero digit.

CU | Arabic | CU | Arabic | CU | Arabic
--- | --- | --- | --- | --- | ---
а҃ | 1 | і҃ | 10 | р҃ | 100
в҃ | 2 | к҃ | 20 | с҃ | 200
г҃ | 3 | л҃ | 30 | т҃ | 300
д҃ | 4 | м҃ | 40 | у҃ | 400
є҃ | 5 | н҃ | 50 | ф҃ | 500
ѕ҃ | 6 | ѯ҃ | 60 | х҃ | 600
з҃ | 7 | ѻ҃ | 70 | ѱ҃ | 700
и҃ | 8 | п҃ | 80 | ѿ҃ | 800
ѳ҃ | 9 | ч҃ | 90 | ц҃ | 900
CU|Arabic|CU|Arabic|CU|Arabic
---|---|---|---|---|---
а҃|1|і҃|10|р҃|100
в҃|2|к҃|20|с҃|200
г҃|3|л҃|30|т҃|300
д҃|4|м҃|40|у҃|400
є҃|5|н҃|50|ф҃|500
ѕ҃|6|ѯ҃|60|х҃|600
з҃|7|ѻ҃|70|ѱ҃|700
и҃|8|п҃|80|ѿ҃|800
ѳ҃|9|ч҃|90|ц҃|900

## 2. Basic numbers
A number `x < 1000` in CU is represented by appropriate registry numerals in descending registry order, except for numbers 11-19, where numerals are swapped.

A number `x < 1000` in CU is represented by a succession of 1 to 3 CU digits that may contain a hundreds digit, a tens digit and a proper digit in that order. Digits representing numbers 11-19 are swapped places, wheter or not a hundreds digit is present.
**Examples:**
CU|Arabic|CU|Arabic|CU|Arabic
---|---|---|---|---|---
а҃|1|і҃|10|р҃|100
|||||р҃а|101
|||||р҃і|110
|||а҃і|11|ра҃і|111
|||к҃а|21|рк҃а|121

For the purpose of this program, this is to be referenced as a "hundred group".
## 3. Thousands and above
In a number `x > 999`, the `҂` "thousand" sign is used before numerals that represent higher order of magnitude. For each thousand sign before a numeral its value is multiplied by 1000.

**Examples:**
CU | Arabic
CU|Arabic
---|---
҂а҃|1 000
҂і҃|10 000
҂р҃|100 000
҂҂а҃|1 000 000

## 4. Number building: multiple styles
There are multiple styles of building numbers with values `x > 999`.

## 4.1. "Plain" style
In "plain" style, "thousand" signs are prepended to each numeral in higher registries, so that only the numeral following is multiplied.

In this style, numerals representing numbers 11-19 are only swapped unless "thousand"-marked.

***Examples:**
CU|Arabic
---|---
а҃ | 1
і҃ | 10
р҃ | 100
ра҃і | 111 - note digit swapping
рк҃а | 121
҂р҂і҂а҂ра҃і|111 111

## 4.2 "Delimeter" style
In "delimeter" style, "thousand" signs are prepended to each group of numerals that form a basic number, so that the whole basic number following is multiplied.

## 3. Thousands
A number `x >= 1000` in CU is prepended with one or more `҂` "thousand" signs. For each "thousand" sign before a number, the number has to be mutiplied by one thousand.
Unlike in "plain", in this style numerals representing numbers 11-19 are swapped on each occurence.

## 4. Number building
**Examples:**
CU|Arabic
---|---
҂раіра҃і|111 111

Altogether, a complete number in CU consists of a succession of hundred groups with "thousand" signs inbetween.
## 4.3 "Circled" style
In "circled" style, a special set of encircling markers is used to denote each higher order of magnitude from ten thousands up to billions.

**Examples:**
CU | Arabic
CU|ARABIC
---|---
а҃ | 1
҂а҃ | 1000
҂҂а҃ | 1000000
҂҂а҂а҃а | 1001001
а&#1160; а&#8413; ҂ара҃і|111 111

## 5. Decoration
Finally, there is a `҃` "titlo" superscript sign that's obligatory to CU numbers. "Titlo" is placed above the 2nd-from-last digit if it exists and is not thousand-marked, otherwise above the last digit.
Finally, there is a `҃`&nbsp; "titlo" superscript sign that's obligatory to CU numbers. "Titlo" is placed above the 2nd-from-last digit if it exists and is not thousand-marked, otherwise above the last digit.

**Examples:**

Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A program for numbers conversion between Church Slavonic script (*further CU*) a

## Background

See [Introduction](./INTRODUCTION.md) to learn about CU numbers.
See [Introduction](./INTRODUCTION.md) to learn about Cyrillic numeral system.

## Requirements

Expand All @@ -21,12 +21,23 @@ See [Introduction](./INTRODUCTION.md) to learn about CU numbers.
# Convert an Arabic number to CU
# Requires non-zero int, returns str

a = cunumbers.arab_to_cu(1)
a = cunumbers.to_cu(1)

# Convert a CU number to an Arabic
# Requires str, returns int

b = cunumbers.cu_to_arab("а҃")
b = cunumbers.to_arab("а҃")

"Delimiter" and "plain" styles are supported. Arabic to CU conversion mode can be specified by supplying a flag. "Delimeter" style is by default.

# Use CU_PLAIN or CU_DELIM to specify Arabic to CU coversion mode

c = cunumbers.to_cu(111111, CU_PLAIN)

# Use CU_NOTITLO flag to omit "titlo"

d = cunumbers.to_cu(11000, CU_PLAIN + CU_NOTITLO)


## Contributing

Expand Down
2 changes: 1 addition & 1 deletion cunumbers/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .cunumbers import arab_to_cu, cu_to_arab
from .cunumbers import *
Loading

0 comments on commit 0cd336f

Please sign in to comment.