#include <string>
#include "translator.h"

namespace translation {
    std::string translateInput(const std::string& input) {
        std::string translatedText{};

        for (std::size_t i = 0; i < input.length(); i++) {
            switch (input[i]) {
                case ';':
                    translatedText.push_back('a');
                break;

                case '@':
                    translatedText.push_back('b');
                break;

                case '*':
                    translatedText.push_back('c');
                break;

                case '<':
                    translatedText.push_back('d');
                break;

                case '&':
                    translatedText.push_back('e');
                break;

                case '(':
                    translatedText.push_back('f');
                break;

                case '"':
                    translatedText.push_back('g');
                break;

                case ')':
                    translatedText.push_back('h');
                break;

                case '[':
                    translatedText.push_back('i');
                break;

                // MISSING J

                // MISSING K

                case '|':
                    translatedText.push_back('l');
                break;

                // MISSING M

                case '/':
                    translatedText.push_back('n');
                break;

                case '?':
                    translatedText.push_back('o');
                break;

                case '+':
                    translatedText.push_back('p');
                break;

                // MISSING Q

                case ']':
                    translatedText.push_back('r');
                break;

                case '{':
                    translatedText.push_back('s');
                break;

                case '}':
                    translatedText.push_back('t');
                break;

                case '.':
                    translatedText.push_back('u');
                break;

                // MISSING V

                case 'w':
                    translatedText.push_back('w');
                break;

                // MISSING X

                // MISSING Y

                // MISSING Z

                case ' ':
                    translatedText.push_back(' ');
                break;

                default:
                    translatedText.push_back('?');
                break;
            }
        }
        return translatedText;
    }
}