Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ENDrain committed Aug 21, 2022
2 parents dfffb95 + afe49c5 commit ebb8751
Show file tree
Hide file tree
Showing 13 changed files with 360 additions and 380 deletions.
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

🌏 English [Русский](./CHANGELOG.ru.md)

## 2.0.0

- Refactoring
- Interface overhaul


## 1.0.0

Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

🌏 [English](./CHANGELOG.md) Русский

## 2.0.0

- Рефакторинг
- Переработка интерфейсов


## 1.0.0

Expand Down
22 changes: 11 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ See [Introduction](./INTRODUCTION.md) to learn about Cyrillic numeral system.

## Usage

import omninumeric.cyrillic as CU
from omninumeric import cyrillic

# Convert a number into Cyrillic
# Requires non-zero int, returns str

a = CU.ArabicNumber(1).convert()
a = cyrillic.write(1)

# Convert a Cyrillic number to Arabic
# Requires non-empty str, returns int

b = CU.CyrillicNumber("а҃").convert()
b = cyrillic.read("а҃")

"Delimiter" and "plain" style numbers are supported both for reading and writing, "plain" style is used by default for writing.

When writing into Cyrillic, several falgs can be used:

# CU_DELIM flag sets conversion to "delimeter" style
# DELIM flag sets conversion to "delimeter" style

c = cu.to_alphabetic(111111, CU_DELIM)
c = cyrillic.write(111111, cyrillic.DELIM)

# CU_NOTITLO flag omits "titlo" decorator
# NOTITLO flag omits "titlo" decorator

d = cu.to_alphabetic(11000, CU_DELIM | CU_NOTITLO)
d = cyrillic.write(11000, cyrillic.DELIM | cyrillic.NOTITLO)

# Following flags control dot styling:
#
# CU_ENDDOT - append dot at the end
# CU_WRAPDOT - append dot at both ends
# CU_DELIMDOT - add dot separator between digit groups. Sets conversion to "delim" style
# CU_ALLDOT - combine CU_WRAPDOT and CU_DELIMDOT
# ENDDOT - append dot at the end
# WRAPDOT - append dot at both ends
# DELIMDOT - add dot separator between digit groups. Sets conversion to "delim" style
# ALLDOT - combine WRAPDOT and DELIMDOT


## Contributing
Expand Down
22 changes: 11 additions & 11 deletions docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@

## Использование

import omninumeric.cyrillic as cu
from omninumeric import cyrillic

# Преобразовать арабское число в церковнославянское
# Принимает ненулевой int, возвращает str

a = CU.ArabicNumber(1).convert()
a = cyrillic.write(1)

# Преобразовать церковнославянское число в арабское
# Принимает непустой str, возвращает int

b = CU.CyrillicNumber("а҃").convert()
b = cyrillic.read("а҃")

В обоих направлениях поддерживаются варианты записи "сплошной" и "по группам", "сплошная" запись используется по умолчанию.

При записи в ЦСЯ возможно использование слеедующих флагов:

# CU_DELIM устанавливает вариант записи в ЦСЯ "по группам"
# DELIM устанавливает вариант записи в ЦСЯ "по группам"

c = cu.to_alphabetic(111111, CU_DELIM)
c = cyrillic.write(111111, cyrillic.DELIM)

# CU_NOTITLO опускает вывод знака "титло"
# NOTITLO опускает вывод знака "титло"

d = cu.to_alphabetic(11000, CU_DELIM | CU_NOTITLO)
d = cyrillic.write(11000, cyrillic.DELIM | cyrillic.NOTITLO)

# Следующие флаги управляют декорированием точками:
#
# CU_ENDDOT - выводит точку в конце
# CU_WRAPDOT - выводит точки с обеих сторон
# CU_DELIMDOT - выводит точки-разделители разрядов. Устанавливает вариант записи "по группам"
# CU_ALLDOT - комбинация флагов CU_WRAPDOT и CU_DELIMDOT
# ENDDOT - выводит точку в конце
# WRAPDOT - выводит точки с обеих сторон
# DELIMDOT - выводит точки-разделители разрядов. Устанавливает вариант записи "по группам"
# ALLDOT - комбинация флагов WRAPDOT и DELIMDOT


## Принять участие
Expand Down
8 changes: 2 additions & 6 deletions omninumeric/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from .omninumeric import (
Dictionary,
IntNumberConverter,
StrNumberConverter,
)
from .omninumeric import *

__all__ = ["Dictionary", "IntNumberConverter", "StrNumberConverter"]
__all__ = ["Dictionary", "IntConverter", "StrConverter"]
36 changes: 12 additions & 24 deletions omninumeric/cyrillic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
from .cyrillic import (
CU_PLAIN,
CU_DELIM,
CU_NOTITLO,
CU_ENDDOT,
CU_DELIMDOT,
CU_WRAPDOT,
CU_ALLDOT,
ArabicNumber,
CyrillicNumber,
to_cu,
to_arab,
)
from .cyrillic import *

__all__ = [
"ArabicNumber",
"CyrillicNumber",
"to_cu",
"to_arab",
"CU_PLAIN",
"CU_DELIM",
"CU_NOTITLO",
"CU_ENDDOT",
"CU_DELIMDOT",
"CU_WRAPDOT",
"CU_ALLDOT",
"PLAIN",
"DELIM",
"NOTITLO",
"ENDDOT",
"PREDOT",
"DOT",
"DELIMDOT",
"WRAPDOT",
"ALLDOT",
"read",
"write",
]
Loading

0 comments on commit ebb8751

Please sign in to comment.