summaryrefslogtreecommitdiff
path: root/src/lib/prononciation.mly
blob: f865abda0de05d6ecd8a20b5fd6d65989eb39159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%{

    (** This module transform the words into a semi-prononciation elements. 

    The letters should be quite close with the associate phonem, but some
    modification can occur.

     *)

    open Tokens
%}

%start<Tokens.token list> main
%%

initial_voyel:
  | A { A }
  | E { E }
  | I { I }
  | O { O }
  | U { U }
  | E_ACUTE { E_ACUTE }

voyel: 
  | initial_voyel { $1 }
  

letters:
  |                 { [] }
  | letters voyel  { $2 :: $1 }
  | letters Space   { Space :: $1 }
  | letters Sep     { Sep :: $1 }

  | letters B       { B :: $1 }
  | letters C  %prec Low     { K :: $1 }
  | letters C H     { X :: $1 }
  | letters C I     { I :: S :: $1 }
  | letters C E     { E :: S :: $1 }
  | letters C U I   { I :: K :: $1 }
  | letters C U E   { E :: K :: $1 }
  | letters D       { D :: $1 }
  | letters F       { F :: $1 }
  | letters G %prec Low      { G :: $1 }
  | letters G I     { I :: J :: $1 }
  | letters G E     { E :: J :: $1 }
  | letters G U I   { I :: G :: $1 }
  | letters G U E   { E :: G :: $1 }

  | letters J       { J :: $1 }
  | letters K       { K :: $1 }
  | letters L       { L :: $1 }
  | letters M       { M :: $1 }
  | letters N       { N :: $1 }
  | letters P       { P :: $1 }
  | letters P H     { F :: $1 }

  | letters Q U     { K :: $1 }

  | letters R       { R :: $1 }
  | letters S S     { S :: $1 }
  | letters S       { SZ :: $1 }
  | letters T       { T :: $1 }

  | letters V       { V :: $1 }
  | letters W       { V :: $1 }
  | letters X       { S :: K :: $1 }
  | letters Y       { I :: $1 }

  | letters Z       { Z :: $1 }

main: 
    letters EOL { EOL::$1 }