Git Product home page Git Product logo

number-to-georgian-cpp's Introduction

Number to Georgian (C++ Version)

Convert a number to Georgian words, or to a symbolic representation

GitHub Language

Features

  • Header-only.
  • Requires only standard C++ (C++17).
  • Extensively tested using 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

#include "number_to_georgian.h"

// ...

assert(NumberToGeorgian::toWords(0) == "ნული");
assert(NumberToGeorgian::toSymbolic(0) == std::vector<std::string>{"0"});

assert(NumberToGeorgian::toWords(-6'872'146)
	== "მინუს ექვსი მილიონ რვაას სამოცდათორმეტი ათას ას ორმოცდაექვსი");
assert(NumberToGeorgian::toSymbolic(-6'872'146)
	== std::vector<std::string>{"minus", "6", "1e6_", "800_", "60_", "12", "1000_", "100_", "40_", "6"});

assert(NumberToGeorgian::toWords(std::numeric_limits<std::int64>::min())
		== "მინუს ცხრა კვინტილიონ "
		"ორას ოცდასამი კვადრილიონ "
		"სამას სამოცდათორმეტი ტრილიონ "
		"ოცდათექვსმეტი მილიარდ "
		"რვაას ორმოცდათოთხმეტი მილიონ "
		"შვიდას სამოცდათხუთმეტი ათას "
		"რვაას რვა");

Please see NumberToGeorgian::toSymbolic for a list of possible returned values.

Copyright

Copyright: Alexander Shaduri [email protected]
License: Zlib

number-to-georgian-cpp's People

Contributors

ashaduri avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.