// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.HashMap;
import java.util.Map;

public class Good {
    private static Map<String, String> translation = new HashMap<String, String>();
    static {
        translation.put("Moscow", "Leningrad");
        translation.put("is", "was");
        translation.put("the", "a");
        translation.put("capital", "state");
        translation.put("of", "by");
        translation.put("Russia", "Romania");
    }
    public static void test(String s) {
        for(String w : s.split("\\W")) {
            String w2 = translation.get(w);
            if(w2 != null) {
                System.out.println(w + " -> " + w2);
            } else {
                System.out.println(w);
            }
        }
    }
    public static void main(String[] args) {
        test("Moscow is the capital of Russia X");
    }
}
