Beispiel #1
0
 public Word(MorfeuszDllWrapper.InterpMorf _interpMorf)
 {
     Interpret(_interpMorf);
 }
Beispiel #2
0
        /// <summary>
        /// Interpret word
        /// </summary>
        /// <param name="_interpMorf">interpreted parameters</param>
        public void Interpret(MorfeuszDllWrapper.InterpMorf _interpMorf)
        {
            this.k    = _interpMorf.k;
            this.p    = _interpMorf.p;
            this.Mark = _interpMorf.interp;

            string[] interpParams = _interpMorf.interp.Split(':');

            this.Form     = _interpMorf.forma;
            this.FormBase = _interpMorf.haslo;
            if (this.FormBase.Contains(':'))
            {
                this.FormBase = this.FormBase.Substring(0, this.FormBase.IndexOf(':'));
            }

            if (interpParams.Length > 0)
            {
                this.SetPartOfSpeech(interpParams[0]);
                if (PartOfSpeech == SpeechPart.Other &&
                    this.FormBase == ",")
                {   // Traktujemy przecinek jako spójnik!
                    PartOfSpeech = SpeechPart.Conjuctiun;
                }

                for (int parNum = 1; parNum < interpParams.Length; parNum++)
                {
                    string par = interpParams[parNum];

                    switch (interpParams[parNum])
                    {
                    case "sg":
                        this.Number = interpParams[parNum];
                        break;

                    case "pl":
                        if (parNum == 1)
                        {
                            this.Number = interpParams[parNum];
                        }
                        else
                        {
                            this.Type = interpParams[parNum];
                        }
                        break;

                    case "nom":
                        this.Case = interpParams[parNum];
                        break;

                    case "gen":
                        this.Case = interpParams[parNum];
                        break;

                    case "dat":
                        this.Case = interpParams[parNum];
                        break;

                    case "acc":
                        this.Case = interpParams[parNum];
                        break;

                    case "inst":
                        this.Case = interpParams[parNum];
                        break;

                    case "loc":
                        this.Case = interpParams[parNum];
                        break;

                    case "voc":
                        this.Case = interpParams[parNum];
                        break;

                    case "m1":
                        this.Type = interpParams[parNum];
                        break;

                    case "m2":
                        this.Type = interpParams[parNum];
                        break;

                    case "m3":
                        this.Type = interpParams[parNum];
                        break;

                    case "f":
                        this.Type = interpParams[parNum];
                        break;

                    case "n1":
                        this.Type = interpParams[parNum];
                        break;

                    case "n2":
                        this.Type = interpParams[parNum];
                        break;

                    //case "pl":
                    //    this.Type = interpParams[parNum];
                    //    break;
                    case "p1":
                        this.Type = interpParams[parNum];
                        break;

                    case "p2":
                        this.Type = interpParams[parNum];
                        break;

                    case "p3":
                        this.Type = interpParams[parNum];
                        break;

                    default:
                        break;
                    }
                }
            }
        }