Exemplo n.º 1
0
    private bool PrasaCheck(string s1, string s2)
    {
        YatiPrasaChecker2 Y = new YatiPrasaChecker2( );
        bool f = Y.IsPrasaMatched(s1, s2);

        return(f);
    }
Exemplo n.º 2
0
        private string PrasaString2(string nm, string prasa)
        {
            if (prasa == "")
            {
                return(StringWith1(nm));
            }

            string s = "";

            bool matched = false;

            while (!matched)
            {
                s = StringWith1(nm);
                {
                    string lp = s.Split(',')[1];
                    matched = Y.IsPrasaMatched(lp, prasa);
                }
            }
            return(s);
        }
Exemplo n.º 3
0
        public string CheckPrasa(string s1, string s2, bool allowSantiPrasa)
        {
            YatiPrasaChecker2 Y = new YatiPrasaChecker2();

            s1 = s1.Replace(" ", "");
            s2 = s2.Replace(" ", "");

            Y.AllowSantiPrasa = allowSantiPrasa;
            Y.SoundexSandhi   = false;
            GanaVibhajana G1 = new GanaVibhajana(s1, lang);
            GanaVibhajana G2 = new GanaVibhajana(s2, lang);

            if (G1.GWiseString.Count == 0)
            {
                return("<span class='gName'>Group-1 is not valid</span>");
            }
            if (G2.GWiseString.Count == 0)
            {
                return("<span class='gName'>Group-2 is not valid</span>");
            }

            bool f = false;

            if (G1.GWiseString.Count > 1 && G2.GWiseString.Count > 1)
            {
                p1 = G1.GWiseString[0] + "<u>" + G1.GWiseString[1] + "</u>";
                p2 = G2.GWiseString[0] + "<u>" + G2.GWiseString[1] + "</u>";

                Prasa P1 = new Prasa(StringPlus.CharAt(G1.SymbolsStream, 0).ToString(), false, G1.GWiseString[1], G1.GWiseString[0]);
                Prasa P2 = new Prasa(StringPlus.CharAt(G2.SymbolsStream, 0).ToString(), false, G2.GWiseString[1], G2.GWiseString[0]);

                f = Y.IsPrasaMatched3(P1, P2);

                if (f && Y.NoMoreChecks)
                {
                    return(Success(p1, p2, PRASA, Y.LastName));
                }

                if (f)
                {
                    if (P1.Symbol == Symbols.LAGHUVU)
                    {
                        //Nothing to do..
                    }
                    else
                    {
                        f = (P1.Symbol == P2.Symbol);
                    }
                }


                if (f)
                {
                    Errors E = CheckPrasaPoorva2(Y, P1, P2);
                    if (E == null)
                    {
                        return(Success(p1, p2, PRASA, Y.LastName));
                    }
                    return(FailWith(p1, p2, E, PRASA));
                }
                else
                {
                    return(FailWith(p1, p2, null, PRASA));
                }
            }
            else
            {
                p1 = G1.GWiseString[0];
                p2 = G2.GWiseString[0];
                f  = Y.IsPrasaMatched(p1, p2);
                if (f)
                {
                    return(Success(p1, p2, PRASA, Y.LastName));
                }
            }
            return(FailWith(p1, p2, null, PRASA));
        }