LetterFrequency (%)
a6.2193%
á2.2355%
b1.5582%
c1.6067%
č0.9490%
d3.6019%
ď0.0222%
e7.6952%
é1.3346%
ě1.6453%
f0.2732%
g0.2729%
h1.2712%
ch1.1709%
i4.3528%
í3.2699%
j2.1194%
k3.7367%
l3.8424%
m3.2267%
n6.5353%
ň0.0814%
o8.6664%
ó0.0313%
p3.4127%
q0.0013%
r3.6970%
ř1.2166%
s4.5160%
š0.8052%
t5.7268%
ť0.0426%
u3.1443%
ú0.1031%
ů0.6948%
v4.6616%
w0.0088%
x0.0755%
y1.9093%
ý1.0721%
z2.1987%
ž0.9952%
Relative letter frequencies (%)

Bigraphs

ST, PR, SK, CH, DN, TR

Trigraphs

PRO, UNI, OST, STA, ANI, OVA, YCH, STI, PRI, PRE, OJE, REN, IST, STR, EHO, TER, RED, ICH


Code

    /**
     * Prints out frequencies of input characters (in percent)
     * @param source input file
     * @param encoding encoding of the file
     */
    public static void count(File source, String encoding) throws UnsupportedEncodingException, IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(source), encoding));
        
        TreeMap<Character, Integer> occurences = new TreeMap<Character, Integer>();

        String s = null;
        int counter = 0;
        while((s = reader.readLine())!= null){
            for(int i = 0; i < s.length(); i++){
                counter++;
                Character curr = (Character) s.charAt(i);
                if(occurences.get(curr) == null){
                    occurences.put(curr, new Integer(1));
                } else {
                    occurences.put(curr, occurences.get(curr).intValue() + 1);
                }
            }
        }

        for(Character ch : occurences.keySet()){
            System.out.println(ch.toString() + ": " + (occurences.get(ch).intValue()/(double)counter * 100));
        }
    }

Sources

  • KRÁLÍK, Jan. Czech Alphabet. The Czech Language [online]. 2001 [cit. 2012-09-18]. Available at WWW: http://www.czech-language.cz/alphabet/alph-prehled.html







       
 

Place for your banner

Here is the position ready for our customer's banners.