// Path: src/org/forecat/console/utils/UtilsConsole.java
// public class UtilsConsole {
// 	public static InputStream openFile(String file) {
// 		InputStream ret = null;
// 
// 		ret = Main.class.getResourceAsStream(file);
// 
// 		if (ret == null) {
// 			try {
// 				ret = new FileInputStream(file);
// 			} catch (FileNotFoundException e) {
// 				// TODO Auto-generated catch block
// 				e.printStackTrace();
// 			}
// 		}
// 
// 		return ret;
// 	}
// 
// 	public static Integer multiMax(Integer a, Integer... b) {
// 		for (Integer i : b) {
// 			a = Math.max(a, i);
// 		}
// 
// 		return a;
// 	}
// }


import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.collections4.map.MultiValueMap;
import org.forecat.console.utils.UtilsConsole;
import org.forecat.shared.translation.SourceSegment;

		for (SourceSegment s : sSegments) {
			sSegment = s.getSourceSegmentText();// .toLowerCase();
			tSegment = transSegments.get(sSegment);
			tSegment = (tSegment != null) ? tSegment : "";
			// tSegment = tSegment.toLowerCase();
			ret.add(matchUpper(s.getSourceSegmentText(), tSegment.trim()));
			//
			// if (!tSegment.trim().equals(matchUpper(s.getSourceSegmentText(), tSegment)))
			// System.err.println(s.getSourceSegmentText() + "|" + tSegment + "|"
			// + matchUpper(s.getSourceSegmentText(), tSegment) + "|");

			// ret.add(matchUpper(s.getSourceSegmentText(), tSegment));
		}

		return ret;
	}

	public static String matchUpper(String source, String target) {
		StringBuilder sb = new StringBuilder();

		String[] sourceSplit = source.split(" ");
		String[] targetSplit = target.split(" ");

		int sourceLength = sourceSplit.length;

		String sourceWord;
		String targetWord;

		for (int i = 0; i < targetSplit.length; i++) {
// Path: src/org/forecat/console/utils/UtilsConsole.java
// public class UtilsConsole {
// 	public static InputStream openFile(String file) {
// 		InputStream ret = null;
// 
// 		ret = Main.class.getResourceAsStream(file);
// 
// 		if (ret == null) {
// 			try {
// 				ret = new FileInputStream(file);
// 			} catch (FileNotFoundException e) {
// 				// TODO Auto-generated catch block
// 				e.printStackTrace();
// 			}
// 		}
// 
// 		return ret;
// 	}
// 
// 	public static Integer multiMax(Integer a, Integer... b) {
// 		for (Integer i : b) {
// 			a = Math.max(a, i);
// 		}
// 
// 		return a;
// 	}
// }


// Path: src/org/forecat/server/translation/cachetrans/Cachetrans.java
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.collections4.map.MultiValueMap;
import org.forecat.console.utils.UtilsConsole;
import org.forecat.shared.translation.SourceSegment;


		for (SourceSegment s : sSegments) {
			sSegment = s.getSourceSegmentText();// .toLowerCase();
			tSegment = transSegments.get(sSegment);
			tSegment = (tSegment != null) ? tSegment : "";
			// tSegment = tSegment.toLowerCase();
			ret.add(matchUpper(s.getSourceSegmentText(), tSegment.trim()));
			//
			// if (!tSegment.trim().equals(matchUpper(s.getSourceSegmentText(), tSegment)))
			// System.err.println(s.getSourceSegmentText() + "|" + tSegment + "|"
			// + matchUpper(s.getSourceSegmentText(), tSegment) + "|");

			// ret.add(matchUpper(s.getSourceSegmentText(), tSegment));
		}

		return ret;
	}

	public static String matchUpper(String source, String target) {
		StringBuilder sb = new StringBuilder();

		String[] sourceSplit = source.split(" ");
		String[] targetSplit = target.split(" ");

		int sourceLength = sourceSplit.length;

		String sourceWord;
		String targetWord;

		for (int i = 0; i < targetSplit.length; i++) {
			if (sb.length() > 0)