47 $allVowels = [
"е",
"и",
"э",
"ө",
"ү",
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
48 $frontVowels = [
"е",
"и",
"э",
"ө",
"ү" ];
49 $backVowels = [
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
50 $unroundFrontVowels = [
"е",
"и",
"э" ];
51 $roundFrontVowels = [
"ө",
"ү" ];
52 $unroundBackVowels = [
"а",
"ы",
"я" ];
53 $roundBackVowels = [
"ё",
"о",
"у",
"ю" ];
54 $unvoicedPhonemes = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х" ];
55 $directiveUnvoicedStems = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х",
"л",
"м",
"н",
"ң" ];
56 $directiveVoicedStems = [
"д",
"б",
"з",
"ж",
"г",
"р",
"й" ];
62 $wordEnding = $ar[0][count( $ar[0] ) - 1];
69 $wordLastVowel =
null;
70 foreach ( $wordReversed as $xvalue ) {
71 foreach ( $allVowels as $yvalue ) {
72 if (
strcmp( $xvalue, $yvalue ) == 0 ) {
78 if ( $wordLastVowel !==
null ) {
86 if (
in_array( $wordEnding, $unvoicedPhonemes ) ) {
87 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
88 $word = implode(
"", $ar[0] ) .
"түң";
90 $word = implode(
"", $ar[0] ) .
"тиң";
92 $word = implode(
"", $ar[0] ) .
"туң";
94 $word = implode(
"", $ar[0] ) .
"тың";
97 }
elseif ( $wordEnding ===
"л" ) {
98 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
99 $word = implode(
"", $ar[0] ) .
"дүң";
101 $word = implode(
"", $ar[0] ) .
"диң";
103 $word = implode(
"", $ar[0] ) .
"дуң";
105 $word = implode(
"", $ar[0] ) .
"дың";
109 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
110 $word = implode(
"", $ar[0] ) .
"нүң";
112 $word = implode(
"", $ar[0] ) .
"ниң";
114 $word = implode(
"", $ar[0] ) .
"нуң";
116 $word = implode(
"", $ar[0] ) .
"ның";
122 if (
in_array( $wordEnding, $unvoicedPhonemes ) ) {
123 if (
in_array( $wordLastVowel, $frontVowels ) ) {
124 $word = implode(
"", $ar[0] ) .
"ке";
126 $word = implode(
"", $ar[0] ) .
"ка";
130 if (
in_array( $wordLastVowel, $frontVowels ) ) {
131 $word = implode(
"", $ar[0] ) .
"ге";
133 $word = implode(
"", $ar[0] ) .
"га";
139 if (
in_array( $wordEnding, $unvoicedPhonemes ) ) {
140 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
141 $word = implode(
"", $ar[0] ) .
"тү";
143 $word = implode(
"", $ar[0] ) .
"ти";
145 $word = implode(
"", $ar[0] ) .
"ту";
147 $word = implode(
"", $ar[0] ) .
"ты";
150 }
elseif ( $wordEnding ===
"л" ) {
151 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
152 $word = implode(
"", $ar[0] ) .
"дү";
154 $word = implode(
"", $ar[0] ) .
"ди";
156 $word = implode(
"", $ar[0] ) .
"ду";
158 $word = implode(
"", $ar[0] ) .
"ды";
162 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
163 $word = implode(
"", $ar[0] ) .
"нү";
165 $word = implode(
"", $ar[0] ) .
"ни";
167 $word = implode(
"", $ar[0] ) .
"ну";
169 $word = implode(
"", $ar[0] ) .
"ны";
175 if (
in_array( $wordEnding, $unvoicedPhonemes ) ) {
176 if (
in_array( $wordLastVowel, $frontVowels ) ) {
177 $word = implode(
"", $ar[0] ) .
"те";
179 $word = implode(
"", $ar[0] ) .
"та";
183 if (
in_array( $wordLastVowel, $frontVowels ) ) {
184 $word = implode(
"", $ar[0] ) .
"де";
186 $word = implode(
"", $ar[0] ) .
"да";
192 if (
in_array( $wordEnding, $unvoicedPhonemes ) ) {
193 if (
in_array( $wordLastVowel, $frontVowels ) ) {
194 $word = implode(
"", $ar[0] ) .
"тен";
196 $word = implode(
"", $ar[0] ) .
"тан";
200 if (
in_array( $wordLastVowel, $frontVowels ) ) {
201 $word = implode(
"", $ar[0] ) .
"ден";
203 $word = implode(
"", $ar[0] ) .
"дан";
209 if (
in_array( $wordEnding, $directiveVoicedStems ) ) {
210 $word = implode(
"", $ar[0] ) .
"же";
212 $word = implode(
"", $ar[0] ) .
"че";
217 if (
in_array( $wordEnding, $unvoicedPhonemes ) ) {
218 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
219 $word = implode(
"", $ar[0] ) .
"түве";
221 $word = implode(
"", $ar[0] ) .
"тиве";
223 $word = implode(
"", $ar[0] ) .
"туве";
225 $word = implode(
"", $ar[0] ) .
"тыве";
229 if (
in_array( $wordLastVowel, $roundFrontVowels ) ) {
230 $word = implode(
"", $ar[0] ) .
"дүве";
232 $word = implode(
"", $ar[0] ) .
"диве";
234 $word = implode(
"", $ar[0] ) .
"дуве";
236 $word = implode(
"", $ar[0] ) .
"дыве";