Commit c3b6dbce7336e09598d3004b52f3ceca7682e2f2
1 parent
e009f3c8
Uaktualnienie wizualizacji modelu fonetycznego
Showing
4 changed files
with
58 additions
and
39 deletions
morphology/doc/model2.pdf
No preview for this file type
morphology/doc/model2.tex
... | ... | @@ -51,38 +51,38 @@ ale z każdej z nich można wydedukować pierwotną postać. |
51 | 51 | |
52 | 52 | Reguły dla form pisanych zgodnie ze standardową ortografią mają postać: |
53 | 53 | \begin{center} |
54 | -\begin{tabular}{l|l|l|l|l|l|l} | |
55 | -1 & 2 & 3 & 4 & 5 & 6 & 7\\ | |
56 | -\hline | |
57 | - & & & & & a\textipa{\super{j}} $\leftarrow$ a & \\ | |
58 | -b$'$ $\leftarrow$ bi & b$'$ $\leftarrow$ b & bj $\leftarrow$ bi & & & & \\ | |
59 | -d$'$ $\leftarrow$ dzi & d$'$ $\leftarrow$ dz & & \textipa{Z} $\leftarrow$ dz & d$'$ $\leftarrow$ dź & & \\ | |
60 | -d\textipa{\super{j}} $\leftarrow$ di & d\textipa{\super{j}} $\leftarrow$ d & dj $\leftarrow$ di & & & & \\ | |
61 | - & & & & & e\textipa{\super{j}} $\leftarrow$ e & \\ | |
62 | -f$'$ $\leftarrow$ fi & f$'$ $\leftarrow$ f & fj $\leftarrow$ fi & & & & \\ | |
63 | -g$'$ $\leftarrow$ gi & g$'$ $\leftarrow$ g & g$'$j $\leftarrow$ gi & & & & \\ | |
64 | -h\textipa{\super{j}} $\leftarrow$ hi & h\textipa{\super{j}} $\leftarrow$ h & & & & & \\ | |
65 | - & & & & & i\textipa{\super{j}} $\leftarrow$ i & \\ | |
66 | -k$'$ $\leftarrow$ ki & k$'$ $\leftarrow$ k & k$'$j $\leftarrow$ ki & & & & \\ | |
67 | -l\textipa{\super{j}} $\leftarrow$ li & & lj $\leftarrow$ li & & & & \\ | |
68 | -m$'$ $\leftarrow$ mi & m$'$ $\leftarrow$ m & m$'$j $\leftarrow$ mi & & & & \\ | |
69 | -n$'$ $\leftarrow$ ni & n$'$ $\leftarrow$ n & n$'$j $\leftarrow$ ni & & n$'$ $\leftarrow$ ń & & \\ | |
70 | - & & & & & o\textipa{\super{j}} $\leftarrow$ o & \\ | |
71 | -p$'$ $\leftarrow$ pi & p$'$ $\leftarrow$ p & pj $\leftarrow$ pi & & & & \\ | |
72 | -r\textipa{\super{j}} $\leftarrow$ ri & r\textipa{\super{j}} $\leftarrow$ r & rj $\leftarrow$ ri & ř $\leftarrow$ rz & & & r $\leftarrow$ r\\ | |
73 | -s$'$ $\leftarrow$ si & s$'$ $\leftarrow$ s & & & s$'$ $\leftarrow$ ś & & \\ | |
74 | -t$'$ $\leftarrow$ ci & t$'$ $\leftarrow$ c & & & t$'$ $\leftarrow$ ć & & \\ | |
75 | -t\textipa{\super{j}} $\leftarrow$ ti & t\textipa{\super{j}} $\leftarrow$ t & tj $\leftarrow$ ti & & & & \\ | |
76 | - & & & & & u\textipa{\super{j}} $\leftarrow$ u & \\ | |
77 | -v$'$ $\leftarrow$ wi & v$'$ $\leftarrow$ w & vj $\leftarrow$ wi & v $\leftarrow$ w & & & \\ | |
78 | -x\textipa{\super{j}} $\leftarrow$ chi & x\textipa{\super{j}} $\leftarrow$ ch & x\textipa{\super{j}}j $\leftarrow$ chi & x $\leftarrow$ ch & & & \\ | |
79 | - & & & & & y\textipa{\super{j}} $\leftarrow$ y & \\ | |
80 | -z$'$ $\leftarrow$ zi & z$'$ $\leftarrow$ z & & & z$'$ $\leftarrow$ ź & & \\ | |
81 | - & & & & & ó\textipa{\super{j}} $\leftarrow$ ó & \\ | |
82 | -č\textipa{\super{j}} $\leftarrow$ czi & č\textipa{\super{j}} $\leftarrow$ cz & & č $\leftarrow$ cz & & & \\ | |
83 | -š\textipa{\super{j}} $\leftarrow$ szi & š\textipa{\super{j}} $\leftarrow$ sz & & š $\leftarrow$ sz & & & \\ | |
84 | -ž\textipa{\super{j}} $\leftarrow$ żi & ž\textipa{\super{j}} $\leftarrow$ ż & žj $\leftarrow$ żi & ž $\leftarrow$ ż & & & \\ | |
85 | -\textipa{\v{Z}}\textipa{\super{j}} $\leftarrow$ dżi & \textipa{\v{Z}}\textipa{\super{j}} $\leftarrow$ dż & \textipa{\v{Z}}j $\leftarrow$ dżi & \textipa{\v{Z}} $\leftarrow$ dż & & & \\ | |
54 | +\begin{tabular}{l|l|l|l|l|l} | |
55 | +1 & 2 & 3 & 4 & 5 & 6 \\ | |
56 | +\hline | |
57 | + & & & & & a\textipa{\super{j}} $\leftarrow$ a\\ | |
58 | +b$'$ $\leftarrow$ bi & b$'$ $\leftarrow$ b & bj $\leftarrow$ bi & & & \\ | |
59 | +d$'$ $\leftarrow$ dzi & d$'$ $\leftarrow$ dz & & \textipa{Z} $\leftarrow$ dz & d$'$ $\leftarrow$ dź & \\ | |
60 | +d\textipa{\super{j}} $\leftarrow$ di & d\textipa{\super{j}} $\leftarrow$ d & dj $\leftarrow$ di & & & \\ | |
61 | + & & & & & e\textipa{\super{j}} $\leftarrow$ e\\ | |
62 | +f$'$ $\leftarrow$ fi & f$'$ $\leftarrow$ f & fj $\leftarrow$ fi & & & \\ | |
63 | +g$'$ $\leftarrow$ gi & g$'$ $\leftarrow$ g & g$'$j $\leftarrow$ gi & & & \\ | |
64 | +h\textipa{\super{j}} $\leftarrow$ hi & h\textipa{\super{j}} $\leftarrow$ h & & & & \\ | |
65 | + & & & & & i\textipa{\super{j}} $\leftarrow$ i\\ | |
66 | +k$'$ $\leftarrow$ ki & k$'$ $\leftarrow$ k & k$'$j $\leftarrow$ ki & & & \\ | |
67 | +l\textipa{\super{j}} $\leftarrow$ li & & lj $\leftarrow$ li & & & \\ | |
68 | +m$'$ $\leftarrow$ mi & m$'$ $\leftarrow$ m & m$'$j $\leftarrow$ mi & & & \\ | |
69 | +n$'$ $\leftarrow$ ni & n$'$ $\leftarrow$ n & n$'$j $\leftarrow$ ni & & n$'$ $\leftarrow$ ń & \\ | |
70 | + & & & & & o\textipa{\super{j}} $\leftarrow$ o\\ | |
71 | +p$'$ $\leftarrow$ pi & p$'$ $\leftarrow$ p & pj $\leftarrow$ pi & & & \\ | |
72 | +r\textipa{\super{j}} $\leftarrow$ ri & r\textipa{\super{j}} $\leftarrow$ r & rj $\leftarrow$ ri & ř $\leftarrow$ rz & & \\ | |
73 | +s$'$ $\leftarrow$ si & s$'$ $\leftarrow$ s & & & s$'$ $\leftarrow$ ś & \\ | |
74 | +t$'$ $\leftarrow$ ci & t$'$ $\leftarrow$ c & & & t$'$ $\leftarrow$ ć & \\ | |
75 | +t\textipa{\super{j}} $\leftarrow$ ti & t\textipa{\super{j}} $\leftarrow$ t & tj $\leftarrow$ ti & & & \\ | |
76 | + & & & & & u\textipa{\super{j}} $\leftarrow$ u\\ | |
77 | +v$'$ $\leftarrow$ wi & v$'$ $\leftarrow$ w & vj $\leftarrow$ wi & v $\leftarrow$ w & & \\ | |
78 | +x\textipa{\super{j}} $\leftarrow$ chi & x\textipa{\super{j}} $\leftarrow$ ch & x\textipa{\super{j}}j $\leftarrow$ chi & x $\leftarrow$ ch & & \\ | |
79 | + & & & & & y\textipa{\super{j}} $\leftarrow$ y\\ | |
80 | +z$'$ $\leftarrow$ zi & z$'$ $\leftarrow$ z & & & z$'$ $\leftarrow$ ź & \\ | |
81 | + & & & & & ó\textipa{\super{j}} $\leftarrow$ ó\\ | |
82 | +č\textipa{\super{j}} $\leftarrow$ czi & č\textipa{\super{j}} $\leftarrow$ cz & & č $\leftarrow$ cz & & \\ | |
83 | +š\textipa{\super{j}} $\leftarrow$ szi & š\textipa{\super{j}} $\leftarrow$ sz & & š $\leftarrow$ sz & & \\ | |
84 | +ž\textipa{\super{j}} $\leftarrow$ żi & ž\textipa{\super{j}} $\leftarrow$ ż & žj $\leftarrow$ żi & ž $\leftarrow$ ż & & \\ | |
85 | +\textipa{\v{Z}}\textipa{\super{j}} $\leftarrow$ dżi & \textipa{\v{Z}}\textipa{\super{j}} $\leftarrow$ dż & \textipa{\v{Z}}j $\leftarrow$ dżi & \textipa{\v{Z}} $\leftarrow$ dż & & \\ | |
86 | 86 | \end{tabular} |
87 | 87 | \end{center} |
88 | 88 | Przy czym regułę z danej kolumny można zastosować, gdy po rozpoznawanej sekwencji znaków znajduje się: |
... | ... | @@ -93,8 +93,20 @@ Przy czym regułę z danej kolumny można zastosować, gdy po rozpoznawanej sekw |
93 | 93 | \item a ą b c ć d e ę f g h k l ł m n ń o ó p r s ś t u w y z ź ż - $\varepsilon$ |
94 | 94 | \item b c ć d f g h k l ł m n ń p r s ś t w z ź ż - $\varepsilon$ |
95 | 95 | \item i |
96 | -\item zi | |
97 | 96 | \end{enumerate} |
97 | +Oprócz powyższych są jeszcze cztery reguły obsługujące sekwencje 'rz' i 'ei': | |
98 | +\begin{center} | |
99 | +\begin{tabular}{l|l} | |
100 | +reguła & prawy kontekst \\ | |
101 | +\hline | |
102 | +r $\leftarrow$ r & zi \\ | |
103 | +mar $\leftarrow$ mar & z\\ | |
104 | +m$'$er $\leftarrow$ mier & z\\ | |
105 | +n$'$e $\leftarrow$ nie & i\\ | |
106 | +\end{tabular} | |
107 | +\end{center} | |
108 | + | |
109 | + | |
98 | 110 | W przypadku, gdy żadna reguła nie ma zastosowania używana jest reguła domyślna przepisująca znak wejściowy bez zmian. |
99 | 111 | Symbol $\varepsilon$ oznacza koniec tokenu. |
100 | 112 | |
... | ... |
morphology/fonetics.ml
... | ... | @@ -69,12 +69,9 @@ let rules, rev_rules = |
69 | 69 | prepare_rules symbol_defs rules, |
70 | 70 | prepare_rules rev_symbol_defs rev_rules |
71 | 71 | |
72 | -let sufs = ["ω"; "iκ"; "ρ"; "δ"; "λ"; "i"; "zi"] | |
72 | +let sufs = ["ω"; "iκ"; "ρ"; "δ"; "λ"; "i"(*; "zi"*)] | |
73 | 73 | |
74 | 74 | let make_key s = |
75 | - if s = "mar" then "" else | |
76 | - if s = "m′er" then "" else | |
77 | - if s = "n′e" then "" else | |
78 | 75 | match Xunicode.utf8_chars_of_utf8_string s with |
79 | 76 | ["ʒ"] -> "d" |
80 | 77 | | ["ř"] -> "r" |
... | ... | @@ -100,9 +97,19 @@ let latex_escape_char = function |
100 | 97 | let latex_of_rule rule = |
101 | 98 | String.concat "" (Xlist.map (Xunicode.utf8_chars_of_utf8_string rule.set) latex_escape_char) ^ " $\\leftarrow$ " ^ rule.find |
102 | 99 | |
100 | +let is_excluded r = | |
101 | + match r.set, r.find, r.suf with | |
102 | + "r", "r", "zi" -> true | |
103 | + | "mar", "mar", "z" -> true | |
104 | + | "m′er", "mier", "z" -> true | |
105 | + | "n′e", "nie", "i" -> true | |
106 | + | _ -> false | |
107 | + | |
108 | + | |
103 | 109 | let latex_of_rules filename = |
104 | 110 | let symbol_defs,rev_symbol_defs,rules,rev_rules = load_rules filename in |
105 | 111 | let map = Xlist.fold rules StringMap.empty (fun map rule -> |
112 | + if is_excluded rule then map else | |
106 | 113 | let key = make_key rule.set in |
107 | 114 | let map2 = try StringMap.find map key with Not_found -> StringMap.empty in |
108 | 115 | if not (Xlist.mem sufs rule.suf) then failwith ("latex_of_rules: " ^ rule.suf) else |
... | ... |
morphology/generate.ml
... | ... | @@ -192,9 +192,9 @@ let _ = |
192 | 192 | () |
193 | 193 | |
194 | 194 | let _ = |
195 | - (* Fonetics.latex_of_rules "data/fonetics_pl.dic"; *) | |
195 | + Fonetics.latex_of_rules "data/fonetics_pl.dic"; | |
196 | 196 | (* Rules.latex_of_alternations "../morphology/data/alternations.dic"; *) |
197 | - Rules.latex_of_schemata (); | |
197 | + (* Rules.latex_of_schemata (); *) | |
198 | 198 | (* Rules.latex_of_interp_rules (); *) |
199 | 199 | () |
200 | 200 | |
... | ... |