Package lesson05

Examples of lesson05.TranslatorController


    public static void main(String[] args) throws IOException {

        //initialization

        SourceLoader sourceLoader = new SourceLoader();
        Translator translator = new Translator(new URLSourceProvider());

        Scanner scanner = new Scanner(System.in);
        System.out.println("Type <exit> or enter the path to a file that need to be translated: ");
        String command = scanner.next();

        while (!"exit".equals(command)) {

            //      So, the only way to stop the application is to do that manually or type "exit"
            // paths:
            // /home/av/Downloads/1.txt
            // https://dl.dropboxusercontent.com/u/14434019/en.txt

            try {
                String source = sourceLoader.loadSource(command);
                String translation = translator.translate(source);

                System.out.println("Original: " + source);
                System.out.println("Translation: " + translation);
View Full Code Here


    public static void main(String[] args) throws IOException {

        //initialization

        SourceLoader sourceLoader = new SourceLoader();
        Translator translator = new Translator(new URLSourceProvider());

        Scanner scanner = new Scanner(System.in);
        System.out.println("Type <exit> or enter the path to a file that need to be translated: ");
        String command = scanner.next();
View Full Code Here

TOP

Related Classes of lesson05.TranslatorController

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.