Created
May 28, 2016 20:44
-
-
Save dvtate/4ef1460eedc658d86f98589a1b1f8281 to your computer and use it in GitHub Desktop.
toki pona runic transliteration tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<boost/algorithm/string/replace.hpp> //boost::replace_all() | |
| std::string texttorunes(std::string text); | |
| std::string runestotext(std::string text); | |
| std::string textinput; | |
| int main(){ | |
| std::cout <<"Toki Pona Runes tool\n\n"; | |
| std::cout <<"Latin -> Runic:\n"; | |
| std::getline(std::cin, textinput); | |
| std::cout <<"==> " <<texttorunes(textinput) <<std::endl; | |
| std::cout <<"\nRunic -> Latin:\n"; | |
| std::getline(std::cin, textinput); | |
| std::cout <<"==> " <<runestotext(textinput) <<std::endl; | |
| return 0; | |
| } | |
| std::string texttorunes(std::string text){ | |
| boost::replace_all(text, "p", "ᛈ"); | |
| boost::replace_all(text, "t", "ᛏ"); | |
| boost::replace_all(text, "k", "ᚲ"); | |
| boost::replace_all(text, "s", "ᛊ"); | |
| boost::replace_all(text, "m", "ᛗ"); | |
| boost::replace_all(text, "n", "ᚾ"); | |
| boost::replace_all(text, "l", "ᛚ"); | |
| boost::replace_all(text, "j", "ᛃ"); | |
| boost::replace_all(text, "w", "ᚹ"); | |
| boost::replace_all(text, "a", "ᚨ"); | |
| boost::replace_all(text, "e", "ᛖ"); | |
| boost::replace_all(text, "i", "ᛁ"); | |
| boost::replace_all(text, "o", "ᛟ"); | |
| boost::replace_all(text, "u", "ᚢ"); | |
| boost::replace_all(text, ".", "᛫"); | |
| return text; | |
| } | |
| std::string runestotext(std::string text){ | |
| boost::replace_all(text, "ᛈ", "p"); | |
| boost::replace_all(text, "ᛏ", "t"); | |
| boost::replace_all(text, "ᚲ", "k"); | |
| boost::replace_all(text, "ᛊ", "s"); | |
| boost::replace_all(text, "ᛗ", "m"); | |
| boost::replace_all(text, "ᚾ", "n"); | |
| boost::replace_all(text, "ᛚ", "l"); | |
| boost::replace_all(text, "ᛃ", "j"); | |
| boost::replace_all(text, "ᚹ", "w"); | |
| boost::replace_all(text, "ᚨ", "a"); | |
| boost::replace_all(text, "ᛖ", "e"); | |
| boost::replace_all(text, "ᛁ", "i"); | |
| boost::replace_all(text, "ᛟ", "o"); | |
| boost::replace_all(text, "ᚢ", "u"); | |
| boost::replace_all(text, "᛫", "."); | |
| return text; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment