static  String translate(String line){
        StringBuilder sb=new StringBuilder();
        int i=0,j=0,size=line.length();
        while (i<size){
            while (i<size &&!Character.isAlphabetic(line.charAt(i))){
                sb.append(line.charAt(i++));
            }
            j=i+1;
            while (j<size && Character.isAlphabetic(line.charAt(j))) j++;
            if(i<size) {
                String word = line.substring(i, j);
                if(dictionary.containsKey(word)){
                    sb.append(dictionary.get(word));
                }else {
                    sb.append(word);
                }
            }
            i=j;
        }
        return sb.toString();
    }