Example #1
0
        private static bool strVVstr(String s1, String s2)
        {
            bool cer;
            char c2;
            char c1;

            c1  = s1[(s1.Length - 1)];
            c2  = s2[0];
            cer = false;
            if (((Divisor.letra(c1) < 6) &&
                 (Divisor.letra(c2) < 6)))
            {
                if (Divisor.hiato(c1, c2))
                {
                    cer = false;
                }
                else
                {
                    cer = true;
                }
            }

            return(cer);
        }
Example #2
0
        private static String silaba(String str)
        {
            String temp = "";
            String s    = "";
            char   z;
            char   x;
            char   y;

            if ((str.Length < 3))
            {
                if ((str.Length == 2))
                {
                    x = str[0];
                    y = str[1];
                    if (((Divisor.letra(x) < 6) &&
                         (Divisor.letra(y) < 6)))
                    {
                        if (Divisor.hiato(x, y))
                        {
                            s = str.Substring(0, 1);
                        }
                        else
                        {
                            s = str;
                        }
                    }
                    else
                    {
                        s = str;
                    }
                }
                else
                {
                    s = str;
                }
            }
            else
            {
                x = str[0];
                y = str[1];
                z = str[2];
                if ((Divisor.letra(x) < 6))
                {
                    // V ? ?
                    if ((Divisor.letra(y) < 6))
                    {
                        // V V ?
                        if ((Divisor.letra(z) < 6))
                        {
                            // V V V
                            if (Divisor.hiato(x, y))
                            {
                                s = str.Substring(0, 1);
                            }
                            else if (Divisor.hiato(y, z))
                            {
                                s = str.Substring(0, 2);
                            }
                            else
                            {
                                s = str.Substring(0, 3);
                            }
                        }
                        else
                        {
                            //  V V C
                            if (Divisor.hiato(x, y))
                            {
                                s = str.Substring(0, 1);
                            }
                            else
                            {
                                s = str.Substring(0, 2);
                            }
                        }
                    }
                    else
                    {
                        //  V C ?
                        if ((Divisor.letra(z) < 6))
                        {
                            // V C V
                            if ((Divisor.letra(y) == 6))
                            {
                                //  V H C
                                if (Divisor.hiato(x, z))
                                {
                                    s = str.Substring(0, 1);
                                }
                                else
                                {
                                    s = str.Substring(0, 3);
                                }
                            }
                            else
                            {
                                s = str.Substring(0, 1);
                            }
                        }
                        else
                        {
                            //  V C C
                            if (Divisor.consonantes1(y, z))
                            {
                                s = str.Substring(0, 1);
                            }
                            else
                            {
                                s = str.Substring(0, 2);
                            }
                        }
                    }
                }
                else
                {
                    //  C ??
                    if ((Divisor.letra(y) < 6))
                    {
                        // C V ?
                        if ((Divisor.letra(z) < 6))
                        {
                            //  C V V
                            temp = str.Substring(0, 3);
                            if ((temp.Equals("que") ||
                                 (temp.Equals("qui") ||
                                  (temp.Equals("gue") || temp.Equals("gui")))))
                            {
                                s = str.Substring(0, 3);
                            }
                            else if (Divisor.hiato(y, z))
                            {
                                s = str.Substring(0, 2);
                            }
                            else
                            {
                                s = str.Substring(0, 3);
                            }
                        }
                        else
                        {
                            //  C V C
                            s = str.Substring(0, 2);
                        }
                    }
                    else
                    {
                        //  C C ?
                        if ((Divisor.letra(z) < 6))
                        {
                            //  C C V
                            if (Divisor.consonantes1(x, y))
                            {
                                s = str.Substring(0, 3);
                            }
                            else
                            {
                                s = str.Substring(0, 1);
                            }
                        }
                        else
                        {
                            //  C C C
                            if (Divisor.consonantes1(y, z))
                            {
                                s = str.Substring(0, 1);
                            }
                            else
                            {
                                s = str.Substring(0, 1);
                            }
                        }
                    }
                }
            }

            return(s);
        }