Package Translator.source

Examples of Translator.source.SourceLoader


public class TranslatorController {

    public static void main(String[] args) throws IOException {
        //initialization
        SourceLoader sourceLoader = new SourceLoader();
        Translator translator = new Translator(new URLSourceProvider());

        System.out.println("Выберите способ загрузки контента:");
        System.out.println("'url' - c интернет ресурса.");
        System.out.println("'file' - c локального файла.");
        System.out.println("'exit' - выход.");
        Scanner scanner = new Scanner(System.in);
        String command = scanner.next();
        while(!"exit".equals(command)) {
            String source = sourceLoader.loadSource(command);
            String translation = translator.translate(source);

            System.out.println("Original: " + source);
            System.out.println("Translation: " + translation.substring(81, translation.indexOf("</text>")));
View Full Code Here

TOP

Related Classes of Translator.source.SourceLoader

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.