How to automatically generate a diacritical vowel table?

I want to have a vowel table with diacritics , but I do not want to manually search for symbol tables.

Is it possible to create this table by going through the list of vowels and the list of diacritics in some of the following languages: Java, PHP, Wolfram Mathematica, .NET languages, etc.

I need to have characters (unicode) as output.

Java solution

I found that there is a special Unicode function for this: http://en.wikipedia.org/wiki/Unicode_normalization

Java supports it with 1.6 http://docs.oracle.com/javase/6/docs/api/java/text/Normalizer.html

So, an example code:

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);
}

those. we just add a combination of diacritics after the vowels, and then apply normalization to the string.

+5
2

, Szabolcs, , , Mathematica,

data = Import["http://unicode.org/Public/UNIDATA/NamesList.txt", "Lines"];

codes = Cases[data, 
 b_String /; StringMatchQ[
  b, ___ ~~ "LATIN " ~~ "CAPITAL" | "SMALL" ~~ " LETTER " ~~ 
   "A" | "E" | "I" | "O" | "U" ~~ " WITH " ~~ ___] :> 
    FromDigits[StringTake[b, 4], 16], Infinity];

FromCharacterCode[codes]

"ÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖØÙÚÛÜàáâãäåèéêëìíîïòóôõöøùúûüĀāĂ㥹ĒēĔĕĖėĘęĚěĨĩĪīĬ\
ĭĮįİŌōŎŏŐőŨũŪūŬŭŮůŰűŲųƗƟƠơƯưǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǞǟǠǡǪǫǬǭǺǻǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍ\
ȎȏȔȕȖȗȦȧȨȩȪȫȬȭȮȯȰȱȺɆɇɨᶏᶒᶖᶙḀḁḔḕḖḗḘḙḚḛḜḝḬḭḮḯṌṍṎṏṐṑṒṓṲṳṴṵṶṷṸṹṺṻẚẠạẢảẤấẦầẨ\
ẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮ\
ữỰựⱥⱸⱺꝊꝋꝌꝍ"
+4

- Mathematica, , . , . !

uninames = 
  StringSplit[
   Import["http://unicode.org/Public/UNIDATA/NamesList.txt", "Text"], 
   "\n"];

uniNameList = ({ToExpression["16^^" <> First[#]], 
      StringJoin@Riffle[Rest[#], "\n"]} & /@ 
    DeleteCases[
     Flatten /@ 
       Split[StringSplit[#, "\t" .., All] & /@ Take[uninames, All], 
        First[#2] === "" &] /. "" -> Sequence[], 
     x_ /; StringTake[First[x], 1] === "@"]);

uniRangeList = {FromDigits[#1, 16], 
     FromDigits[#3, 15], #2} & @@@ (Rest /@ 
     Select[StringSplit[#, "\t"] & /@ uninames, First[#] == "@@" &]);

Clear[unicodeName]
Set[unicodeName[#1], #2] & @@@ uniNameList;
Set[unicodeName[n_Integer /; #1 <= n <= #2], #3] & @@@ uniRangeList;
unicodeName[s_String /; StringLength[s] === 1] := 
 unicodeName[First@ToCharacterCode[s]]
unicodeName[_] := ""

vowelCodes = Select[
  uniNameList[[All, 1]], 
  StringMatchQ[unicodeName[#], 
    "LATIN " ~~ "SMALL" | "CAPITAL" ~~ " LETTER " ~~ 
     "A" | "E" | "I" | "O" | "U" ~~ " WITH" ~~ ___] &
  ]

( , æ),

vowelCodes = Select[
  uniNameList[[All, 1]], 
  StringMatchQ[unicodeName[#], 
    "LATIN " ~~ "SMALL" | "CAPITAL" ~~ " LETTER " ~~ 
     "A" | "E" | "I" | "O" | "U" ~~ ___] &
  ]

( , , ESH - ʃ)

FromCharacterCode /@ vowelCodes, .

"ÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖØÙÚÛÜàáâãäåèéêëìíîïòóôõöøùúûüĀāĂ㥹ĒēĔĕĖėĘęĚěĨĩĪīĬ\
ĭĮįİŌōŎŏŐőŨũŪūŬŭŮůŰűŲųƗƟƠơƯưǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǞǟǠǡǪǫǬǭǺǻǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍ\
ȎȏȔȕȖȗȦȧȨȩȪȫȬȭȮȯȰȱȺɆɇɨᶏᶒᶖᶙḀḁḔḕḖḗḘḙḚḛḜḝḬḭḮḯṌṍṎṏṐṑṒṓṲṳṴṵṶṷṸṹṺṻẚẠạẢảẤấẦầẨ\
ẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮ\
ữỰựⱥⱸⱺꝊꝋꝌꝍ"

, Unicode , (, )

+2

All Articles