https://github.com/ashaduri/number-to-georgian-cpp
Transform any number to a Georgian text (C++ version)
https://github.com/ashaduri/number-to-georgian-cpp
cplusplus cplusplus-17 cpp cpp17 georgian georgian-language number translation words
Last synced: 9 months ago
JSON representation
Transform any number to a Georgian text (C++ version)
- Host: GitHub
- URL: https://github.com/ashaduri/number-to-georgian-cpp
- Owner: ashaduri
- License: zlib
- Created: 2022-02-22T08:16:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T08:44:17.000Z (over 1 year ago)
- Last Synced: 2025-04-07T04:49:28.015Z (about 1 year ago)
- Topics: cplusplus, cplusplus-17, cpp, cpp17, georgian, georgian-language, number, translation, words
- Language: C++
- Homepage:
- Size: 144 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Number to Georgian (C++ Version)
***Convert a number to Georgian words, or to a symbolic representation***


## Features
- Header-only.
- Requires only standard C++ (C++17).
- Extensively tested using [Catch2](https://github.com/catchorg/Catch2).
- Supports the whole 64-bit signed integer range.
- Can output a string of Georgian words.
- Can output a vector of strings, where each element is a symbolic (ASCII) representation
of a Georgian word (or part of a word). This is useful for creating a library of sound
files (e.g. `0.wav`, `minus.wav`, ...) to be used in interactive voice applications, etc...
## Usage Examples
``` C++
#include "number_to_georgian.h"
// ...
assert(NumberToGeorgian::toWords(0) == "ნული");
assert(NumberToGeorgian::toSymbolic(0) == std::vector{"0"});
assert(NumberToGeorgian::toWords(-6'872'146)
== "მინუს ექვსი მილიონ რვაას სამოცდათორმეტი ათას ას ორმოცდაექვსი");
assert(NumberToGeorgian::toSymbolic(-6'872'146)
== std::vector{"minus", "6", "1e6_", "800_", "60_", "12", "1000_", "100_", "40_", "6"});
assert(NumberToGeorgian::toWords(std::numeric_limits::min())
== "მინუს ცხრა კვინტილიონ "
"ორას ოცდასამი კვადრილიონ "
"სამას სამოცდათორმეტი ტრილიონ "
"ოცდათექვსმეტი მილიარდ "
"რვაას ორმოცდათოთხმეტი მილიონ "
"შვიდას სამოცდათხუთმეტი ათას "
"რვაას რვა");
```
Please see `NumberToGeorgian::toSymbolic` for a list of possible returned values.
## Copyright
Copyright: Alexander Shaduri
License: Zlib