I want to have the table of vowels with diacritics, but don't want to search symbol tables manually.
Is it possible to generate this table by crossing the list of vowels and the list of diacritics in some of the following languages: Java, PHP, Wolfram Mathematica, .NET languages and so on?
I need to have characters (unicode) as output.
Java Solution
I found that there are a special Unicode feature for this: http://en.wikipedia.org/wiki/Unicode_normalization
Java supports it since 1.6 http://docs.oracle.com/javase/6/docs/api/java/text/Normalizer.html
So, the sample code is:
public static void main(String[] args) {
String vowels = "aeiou";
char[] diacritics = {'\u0304', '\u0301', '\u0300', '\u030C'};
StringBuilder sb = new StringBuilder();
for(int v=0; v<vowels.length(); ++v) {
for(int d=0; d<diacritics.length; ++d) {
sb.append(vowels.charAt(v));
sb.append(diacritics[d]);
sb.append(' ');
}
sb.append(vowels.charAt(v));
sb.append('\n');
}
String ans = Normalizer.normalize(sb.toString(), Normalizer.Form.NFC);
JOptionPane.showMessageDialog(null, ans);
}
I.e. we just put combining diacritics after vowels and then apply normalization to the string.