|
| 1 | +# OneBitSoftware.Slovom |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +A .NET library that converts currency values into words in Bulgarian for accounting purposes. |
| 6 | + |
| 7 | +## Functionality |
| 8 | +- It takes into consideration the [grammatical gender](https://en.wikipedia.org/wiki/Grammatical_gender). |
| 9 | +- It writes decimal fractions in the short form: `X лева и ст.` when the value is above zero, and the full word when it is under the value of `1`: `девет стотинки`. |
| 10 | +- The current maximum value is `999999.99` and the minimum is `0.`. |
| 11 | + |
| 12 | +## AI Story |
| 13 | +This project is my first attempt to build something with GitHub Copilot. I did my best to not give up on it, however my patience was over at one point. |
| 14 | +GitHub Copilot just couldn't get my requirements thoroughly enough and it never gave something that works without me intervening. |
| 15 | +I made many attempts to improve functions with detailed prompts, but it never gave enough value. |
| 16 | + |
| 17 | +Generating InlineData for the tests failed into an infinite loop (and the token limit kicked in). |
| 18 | + |
| 19 | +Nothing generated as code passed all the tests no matter how I structured prompts. |
| 20 | + |
| 21 | +I eventually had to correct the code myself. The end result is an abomination, but it works. |
| 22 | + |
| 23 | +## Installation |
| 24 | +You can install the OneBitSoftware.Slovom assembly through the NuGet package [NuGet](https://www.nuget.org/packages/OneBitSoftware.Slovom): |
| 25 | +``` |
| 26 | +Install-Package OneBitSoftware.Slovom |
| 27 | +``` |
| 28 | +Or via the .NET Core command line interface: |
| 29 | +``` |
| 30 | +dotnet add package OneBitSoftware.Slovom |
| 31 | +``` |
| 32 | + |
| 33 | +## Examples |
| 34 | + |
| 35 | +|Input|Output| |
| 36 | +|--------|-------| |
| 37 | +|0|нула лева| |
| 38 | +|1|един лев| |
| 39 | +|2|два лева| |
| 40 | +|19|деветнадесет лева| |
| 41 | +|0.1|десет стотинки| |
| 42 | +|1.20|един лев и 20 ст.| |
| 43 | +|1019.78|хиляда и деветнадесет лева и 78 ст.| |
| 44 | +|1119.78|хиляда сто и деветнадесет лева и 78 ст.| |
| 45 | +|32478.27|тридесет и две хиляди четиристотин седемдесет и осем лева и 27 ст.| |
| 46 | + |
| 47 | +## Contributing |
| 48 | +Feel free to raise a PR to improve the code quality or add new features. |
| 49 | + |
| 50 | +## Credits |
| 51 | +Inspired by: |
| 52 | +- https://github.com/imalchev/Slovom |
| 53 | +- https://georgi.unixsol.org/programs/num2bgmoney.php/view/ |
| 54 | +- https://github.com/stuckata/slovom-js |
0 commit comments