RuntimeShengTranslator by @antonymuga.
- This project is all about having fun and also bringing Sheng into the digital age.
- Python programming language has been chosen for this project.
- Current funtionality does not support Python version 2.7
- Follow @RuntimeLab on Twitter for more updates.
- Follow Runtime Lab on LinkedIn for even more updates.
This is a Python code for a Sheng translator that enables users to translate Sheng words into English, French, German, Spanish, and Italian.
The code starts by importing some modules and dictionaries necessary for the project to run. It then defines two functions chosenDictionary and chosenLanguage, which select the active dictionary and language to be used for the translation process.
After that, it defines the RuntimeShengTranslator function, which is the core logic of the program. This function prompts the user to select the language they want to translate to and then asks for a Sheng word to be translated. It then converts the Sheng word to title case if it is not already in title case and checks if the word exists in the chosen dictionary. If the word exists, it prints the translated word and asks the user if they want to translate another Sheng word in the same language. If the user selects yes, the function runs again.
Finally, the program prompts the user to enter a Sheng word to be translated. If the input is empty or contains only spaces, the program will display an error message and prompt the user to enter a Sheng word again. If the user enters three invalid inputs in a row, the program will exit.
Copyright (c) 2018 @RuntimeLab & @antonymuga.
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.