Esempio n. 1
0
 public void AddAttr(AdverbToken adv)
 {
     Pullenti.Semantic.SemAttribute sa = new Pullenti.Semantic.SemAttribute()
     {
         Spelling = adv.Spelling, Typ = adv.Typ, Not = adv.Not
     };
     if (Attrs == null)
     {
         Attrs = new List <SemAttributeEx>();
     }
     Attrs.Add(new SemAttributeEx(adv)
     {
         Attr = sa
     });
 }
Esempio n. 2
0
        public static List <SentItem> ParseNearItems(Pullenti.Ner.Token t, Pullenti.Ner.Token t1, int lev, List <SentItem> prev)
        {
            if (lev > 100)
            {
                return(null);
            }
            if (t == null || t.BeginChar > t1.EndChar)
            {
                return(null);
            }
            List <SentItem> res = new List <SentItem>();

            if (t is Pullenti.Ner.ReferentToken)
            {
                res.Add(new SentItem(t as Pullenti.Ner.MetaToken));
                return(res);
            }
            DelimToken delim = DelimToken.TryParse(t);

            if (delim != null)
            {
                res.Add(new SentItem(delim));
                return(res);
            }
            Pullenti.Ner.Core.ConjunctionToken conj = Pullenti.Ner.Core.ConjunctionHelper.TryParse(t);
            if (conj != null)
            {
                res.Add(new SentItem(conj));
                return(res);
            }
            Pullenti.Ner.Core.PrepositionToken prep = Pullenti.Ner.Core.PrepositionHelper.TryParse(t);
            Pullenti.Ner.Token t111 = (prep == null ? t : prep.EndToken.Next);
            if ((t111 is Pullenti.Ner.NumberToken) && ((t111.Morph.Class.IsAdjective && !t111.Morph.Class.IsNoun)))
            {
                t111 = null;
            }
            Pullenti.Ner.Measure.Internal.NumbersWithUnitToken num = (t111 == null ? null : Pullenti.Ner.Measure.Internal.NumbersWithUnitToken.TryParse(t111, null, false, false, false, false));
            if (num != null)
            {
                if (num.Units.Count == 0)
                {
                    Pullenti.Ner.Core.NounPhraseToken npt1 = Pullenti.Ner.Core.NounPhraseHelper.TryParse(num.EndToken.Next, m_NptAttrs, 0, null);
                    if (npt1 == null && num.EndToken.Next != null && num.EndToken.Next.IsValue("РАЗ", null))
                    {
                        npt1      = new Pullenti.Ner.Core.NounPhraseToken(num.EndToken.Next, num.EndToken.Next);
                        npt1.Noun = new Pullenti.Ner.MetaToken(num.EndToken.Next, num.EndToken.Next);
                    }
                    if (npt1 != null && prep != null)
                    {
                        if (npt1.Noun.EndToken.IsValue("РАЗ", null))
                        {
                            npt1.Morph.RemoveItems(prep.NextCase);
                        }
                        else if (((npt1.Morph.Case & prep.NextCase)).IsUndefined)
                        {
                            npt1 = null;
                        }
                        else
                        {
                            npt1.Morph.RemoveItems(prep.NextCase);
                        }
                    }
                    if ((npt1 != null && npt1.EndToken.IsValue("ОНИ", null) && npt1.Preposition != null) && npt1.Preposition.Normal == "ИЗ")
                    {
                        npt1.Morph       = new Pullenti.Ner.MorphCollection(num.EndToken.Morph);
                        npt1.Preposition = null;
                        string   nn  = num.ToString();
                        SentItem si1 = new SentItem(npt1);
                        if (nn == "1" && (num.EndToken is Pullenti.Ner.NumberToken) && (num.EndToken as Pullenti.Ner.NumberToken).EndToken.IsValue("ОДИН", null))
                        {
                            Pullenti.Semantic.SemAttribute a = new Pullenti.Semantic.SemAttribute()
                            {
                                Typ = Pullenti.Semantic.SemAttributeType.OneOf, Spelling = (num.EndToken as Pullenti.Ner.NumberToken).EndToken.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Singular, Pullenti.Morph.MorphGender.Undefined, false)
                            };
                            SemAttributeEx aex = new SemAttributeEx(num)
                            {
                                Attr = a
                            };
                            si1.Attrs = new List <SemAttributeEx>();
                            si1.Attrs.Add(aex);
                        }
                        else
                        {
                            si1.Quant = new Pullenti.Semantic.SemQuantity(nn, num.BeginToken, num.EndToken);
                        }
                        if (prep != null)
                        {
                            si1.Prep = prep.Normal;
                        }
                        res.Add(si1);
                        return(res);
                    }
                    if (npt1 != null)
                    {
                        SentItem si1 = new SentItem(npt1)
                        {
                            Quant = new Pullenti.Semantic.SemQuantity(num.ToString(), num.BeginToken, num.EndToken)
                        };
                        if (prep != null)
                        {
                            si1.Prep = prep.Normal;
                        }
                        if (npt1.EndToken.IsValue("РАЗ", null))
                        {
                            si1.Typ = SentItemType.Formula;
                        }
                        if (((npt1.Morph.Number & Pullenti.Morph.MorphNumber.Plural)) == Pullenti.Morph.MorphNumber.Undefined && si1.Quant.Spelling != "1")
                        {
                            bool ok = false;
                            if (si1.Quant.Spelling.EndsWith("1"))
                            {
                                ok = true;
                            }
                            else if (si1.Typ == SentItemType.Formula)
                            {
                                ok = true;
                            }
                            else if (si1.Quant.Spelling.EndsWith("2") && npt1.Morph.Case.IsGenitive)
                            {
                                ok = true;
                            }
                            else if (si1.Quant.Spelling.EndsWith("3") && npt1.Morph.Case.IsGenitive)
                            {
                                ok = true;
                            }
                            else if (si1.Quant.Spelling.EndsWith("4") && npt1.Morph.Case.IsGenitive)
                            {
                                ok = true;
                            }
                            if (ok)
                            {
                                npt1.Morph        = new Pullenti.Ner.MorphCollection();
                                npt1.Morph.Number = Pullenti.Morph.MorphNumber.Plural;
                            }
                        }
                        res.Add(si1);
                        return(res);
                    }
                }
                num.BeginToken = t;
                num.Morph      = new Pullenti.Ner.MorphCollection(num.EndToken.Morph);
                SentItem si = new SentItem(num);
                if (prep != null)
                {
                    si.Prep = prep.Normal;
                }
                res.Add(si);
                if (si.Prep == "НА")
                {
                    AdverbToken aa = AdverbToken.TryParse(si.EndToken.Next);
                    if (aa != null && ((aa.Typ == Pullenti.Semantic.SemAttributeType.Less || aa.Typ == Pullenti.Semantic.SemAttributeType.Great)))
                    {
                        si.AddAttr(aa);
                        si.EndToken = aa.EndToken;
                    }
                }
                return(res);
            }
            Pullenti.Morph.MorphClass mc = t.GetMorphClassInDictionary();
            AdverbToken adv = AdverbToken.TryParse(t);

            Pullenti.Ner.Core.NounPhraseToken npt = Pullenti.Ner.Core.NounPhraseHelper.TryParse(t, m_NptAttrs, 0, null);
            if (npt != null && (npt.EndToken is Pullenti.Ner.TextToken) && (npt.EndToken as Pullenti.Ner.TextToken).Term == "БЫЛИ")
            {
                npt = null;
            }
            if (npt != null && adv != null)
            {
                if (adv.EndChar > npt.EndChar)
                {
                    npt = null;
                }
                else if (adv.EndChar == npt.EndChar)
                {
                    res.Add(new SentItem(npt));
                    res.Add(new SentItem(adv));
                    return(res);
                }
            }
            if (npt != null && npt.Adjectives.Count == 0)
            {
                if (npt.EndToken.IsValue("КОТОРЫЙ", null) && t.Previous != null && t.Previous.IsCommaAnd)
                {
                    List <SentItem> res1 = ParseSubsent(npt, t1, lev + 1, prev);
                    if (res1 != null)
                    {
                        return(res1);
                    }
                }
                if (npt.EndToken.IsValue("СКОЛЬКО", null))
                {
                    Pullenti.Ner.Token tt1 = npt.EndToken.Next;
                    if (tt1 != null && tt1.IsValue("ВСЕГО", null))
                    {
                        tt1 = tt1.Next;
                    }
                    Pullenti.Ner.Core.NounPhraseToken npt1 = Pullenti.Ner.Core.NounPhraseHelper.TryParse(tt1, Pullenti.Ner.Core.NounPhraseParseAttr.No, 0, null);
                    if (npt1 != null && !npt1.Morph.Case.IsUndefined && prep != null)
                    {
                        if (((prep.NextCase & npt1.Morph.Case)).IsUndefined)
                        {
                            npt1 = null;
                        }
                        else
                        {
                            npt1.Morph.RemoveItems(prep.NextCase);
                        }
                    }
                    if (npt1 != null)
                    {
                        npt1.BeginToken  = npt.BeginToken;
                        npt1.Preposition = npt.Preposition;
                        npt1.Adjectives.Add(new Pullenti.Ner.MetaToken(npt.EndToken, npt.EndToken));
                        npt = npt1;
                    }
                }
                if (npt.EndToken.Morph.Class.IsAdjective)
                {
                    if (Pullenti.Ner.Core.VerbPhraseHelper.TryParse(t, true, false, false) != null)
                    {
                        npt = null;
                    }
                }
            }
            Pullenti.Ner.Core.VerbPhraseToken vrb = null;
            if (npt != null && npt.Adjectives.Count > 0)
            {
                vrb = Pullenti.Ner.Core.VerbPhraseHelper.TryParse(t, true, false, false);
                if (vrb != null && vrb.FirstVerb.IsParticiple)
                {
                    npt = null;
                }
            }
            else if (adv == null || npt != null)
            {
                vrb = Pullenti.Ner.Core.VerbPhraseHelper.TryParse(t, true, false, false);
            }
            if (npt != null)
            {
                res.Add(new SentItem(npt));
            }
            if (vrb != null && !vrb.FirstVerb.IsParticiple && !vrb.FirstVerb.IsDeeParticiple)
            {
                List <Pullenti.Morph.MorphWordForm> vars = new List <Pullenti.Morph.MorphWordForm>();
                foreach (Pullenti.Morph.MorphBaseInfo wf in vrb.FirstVerb.Morph.Items)
                {
                    if (wf.Class.IsVerb && (wf is Pullenti.Morph.MorphWordForm) && (wf as Pullenti.Morph.MorphWordForm).IsInDictionary)
                    {
                        vars.Add(wf as Pullenti.Morph.MorphWordForm);
                    }
                }
                if (vars.Count < 2)
                {
                    res.Add(new SentItem(vrb));
                }
                else
                {
                    vrb.FirstVerb.VerbMorph = vars[0];
                    res.Add(new SentItem(vrb));
                    for (int i = 1; i < vars.Count; i++)
                    {
                        vrb = Pullenti.Ner.Core.VerbPhraseHelper.TryParse(t, false, false, false);
                        if (vrb == null)
                        {
                            break;
                        }
                        vrb.FirstVerb.VerbMorph = vars[i];
                        res.Add(new SentItem(vrb));
                    }
                    if (vars[0].Misc.Mood == Pullenti.Morph.MorphMood.Imperative && vars[1].Misc.Mood != Pullenti.Morph.MorphMood.Imperative)
                    {
                        SentItem rr = res[0];
                        res[0] = res[1];
                        res[1] = rr;
                    }
                }
                return(res);
            }
            if (vrb != null)
            {
                List <SentItem> res1 = ParseParticiples(vrb, t1, lev + 1);
                if (res1 != null)
                {
                    res.AddRange(res1);
                }
            }
            if (res.Count > 0)
            {
                return(res);
            }
            if (adv != null)
            {
                if (adv.Typ == Pullenti.Semantic.SemAttributeType.Other)
                {
                    Pullenti.Ner.Core.NounPhraseToken npt1 = Pullenti.Ner.Core.NounPhraseHelper.TryParse(adv.EndToken.Next, m_NptAttrs, 0, null);
                    if (npt1 != null && npt1.EndToken.IsValue("ОНИ", null) && npt1.Preposition != null)
                    {
                        SentItem si1 = new SentItem(npt1);
                        Pullenti.Semantic.SemAttribute a = new Pullenti.Semantic.SemAttribute()
                        {
                            Typ = Pullenti.Semantic.SemAttributeType.Other, Spelling = adv.EndToken.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Undefined, Pullenti.Morph.MorphGender.Undefined, false)
                        };
                        SemAttributeEx aex = new SemAttributeEx(num)
                        {
                            Attr = a
                        };
                        si1.Attrs = new List <SemAttributeEx>();
                        si1.Attrs.Add(aex);
                        if (prep != null)
                        {
                            si1.Prep = prep.Normal;
                        }
                        res.Add(si1);
                        return(res);
                    }
                    for (int i = prev.Count - 1; i >= 0; i--)
                    {
                        if (prev[i].Attrs != null)
                        {
                            foreach (SemAttributeEx a in prev[i].Attrs)
                            {
                                if (a.Attr.Typ == Pullenti.Semantic.SemAttributeType.OneOf)
                                {
                                    SentItem si1 = new SentItem(prev[i].Source);
                                    Pullenti.Semantic.SemAttribute aa = new Pullenti.Semantic.SemAttribute()
                                    {
                                        Typ = Pullenti.Semantic.SemAttributeType.Other, Spelling = adv.EndToken.GetNormalCaseText(null, Pullenti.Morph.MorphNumber.Undefined, Pullenti.Morph.MorphGender.Undefined, false)
                                    };
                                    SemAttributeEx aex = new SemAttributeEx(adv)
                                    {
                                        Attr = aa
                                    };
                                    si1.Attrs = new List <SemAttributeEx>();
                                    si1.Attrs.Add(aex);
                                    if (prep != null)
                                    {
                                        si1.Prep = prep.Normal;
                                    }
                                    si1.BeginToken = adv.BeginToken;
                                    si1.EndToken   = adv.EndToken;
                                    res.Add(si1);
                                    return(res);
                                }
                            }
                        }
                    }
                }
                res.Add(new SentItem(adv));
                return(res);
            }
            if (mc.IsAdjective)
            {
                npt = new Pullenti.Ner.Core.NounPhraseToken(t, t)
                {
                    Morph = new Pullenti.Ner.MorphCollection(t.Morph)
                };
                npt.Noun = new Pullenti.Ner.MetaToken(t, t);
                res.Add(new SentItem(npt));
                return(res);
            }
            return(null);
        }
Esempio n. 3
0
        public static Pullenti.Semantic.SemObject CreateAdverb(Pullenti.Semantic.SemGraph gr, AdverbToken adv)
        {
            Pullenti.Semantic.SemObject res = new Pullenti.Semantic.SemObject(gr);
            gr.Objects.Add(res);
            res.Tokens.Add(adv);
            res.Typ = Pullenti.Semantic.SemObjectType.Adverb;
            res.Not = adv.Not;
            res.Morph.NormalCase = (res.Morph.NormalFull = adv.Spelling);
            List <Pullenti.Semantic.Utils.DerivateGroup> grs = Pullenti.Semantic.Utils.DerivateService.FindDerivates(res.Morph.NormalFull, true, null);

            if (grs != null && grs.Count > 0)
            {
                res.Concept = grs[0];
            }
            return(res);
        }
Esempio n. 4
0
        public static Pullenti.Semantic.SemObject CreateVerbGroup(Pullenti.Semantic.SemGraph gr, Pullenti.Ner.Core.VerbPhraseToken vpt)
        {
            List <Pullenti.Semantic.SemObject>    sems    = new List <Pullenti.Semantic.SemObject>();
            List <Pullenti.Semantic.SemAttribute> attrs   = new List <Pullenti.Semantic.SemAttribute>();
            List <Pullenti.Semantic.SemObject>    adverbs = new List <Pullenti.Semantic.SemObject>();

            for (int i = 0; i < vpt.Items.Count; i++)
            {
                Pullenti.Ner.Core.VerbPhraseItemToken v = vpt.Items[i];
                if (v.IsAdverb)
                {
                    AdverbToken adv = AdverbToken.TryParse(v.BeginToken);
                    if (adv == null)
                    {
                        continue;
                    }
                    if (adv.Typ != Pullenti.Semantic.SemAttributeType.Undefined)
                    {
                        attrs.Add(new Pullenti.Semantic.SemAttribute()
                        {
                            Not = adv.Not, Typ = adv.Typ, Spelling = adv.Spelling
                        });
                        continue;
                    }
                    Pullenti.Semantic.SemObject adverb = CreateAdverb(gr, adv);
                    if (attrs.Count > 0)
                    {
                        adverb.Attrs.AddRange(attrs);
                        attrs.Clear();
                    }
                    adverbs.Add(adverb);
                    continue;
                }
                if (v.Normal == "БЫТЬ")
                {
                    int j;
                    for (j = i + 1; j < vpt.Items.Count; j++)
                    {
                        if (!vpt.Items[j].IsAdverb)
                        {
                            break;
                        }
                    }
                    if (j < vpt.Items.Count)
                    {
                        continue;
                    }
                }
                Pullenti.Semantic.SemObject sem = new Pullenti.Semantic.SemObject(gr);
                gr.Objects.Add(sem);
                sem.Tokens.Add(v);
                v.Tag = sem;
                _setMorph(sem, v.VerbMorph);
                sem.Morph.NormalCase = (sem.Morph.NormalFull = v.Normal);
                if (v.IsParticiple || v.IsDeeParticiple)
                {
                    sem.Typ = Pullenti.Semantic.SemObjectType.Participle;
                    sem.Morph.NormalFull = v.EndToken.GetNormalCaseText(Pullenti.Morph.MorphClass.Verb, Pullenti.Morph.MorphNumber.Undefined, Pullenti.Morph.MorphGender.Undefined, false) ?? sem.Morph.NormalCase;
                    sem.Morph.NormalCase = v.EndToken.GetNormalCaseText(Pullenti.Morph.MorphClass.Adjective, Pullenti.Morph.MorphNumber.Undefined, Pullenti.Morph.MorphGender.Undefined, false);
                    if (sem.Morph.NormalCase == sem.Morph.NormalFull && v.Normal.EndsWith("Й"))
                    {
                        List <Pullenti.Semantic.Utils.DerivateGroup> grs2 = Pullenti.Semantic.Utils.DerivateService.FindDerivates(v.Normal, true, null);
                        if (grs2 != null)
                        {
                            foreach (Pullenti.Semantic.Utils.DerivateGroup g in grs2)
                            {
                                foreach (Pullenti.Semantic.Utils.DerivateWord w in g.Words)
                                {
                                    if (w.Lang == v.EndToken.Morph.Language && w.Class.IsVerb && !w.Class.IsAdjective)
                                    {
                                        sem.Morph.NormalFull = w.Spelling;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    else if (sem.Morph.NormalCase == sem.Morph.NormalFull && v.IsParticiple && sem.Morph.NormalFull.EndsWith("Ь"))
                    {
                        foreach (Pullenti.Morph.MorphBaseInfo it in v.EndToken.Morph.Items)
                        {
                            Pullenti.Morph.MorphWordForm wf = it as Pullenti.Morph.MorphWordForm;
                            if (wf == null)
                            {
                                continue;
                            }
                            if (wf.NormalCase.EndsWith("Й") || ((wf.NormalFull != null && wf.NormalFull.EndsWith("Й"))))
                            {
                                sem.Morph.NormalCase = wf.NormalFull ?? wf.NormalCase;
                                break;
                            }
                        }
                        if (sem.Morph.NormalCase == sem.Morph.NormalFull)
                        {
                            List <Pullenti.Semantic.Utils.DerivateGroup> grs2 = Pullenti.Semantic.Utils.DerivateService.FindDerivates(sem.Morph.NormalCase, true, null);
                            if (grs2 != null)
                            {
                                foreach (Pullenti.Semantic.Utils.DerivateGroup g in grs2)
                                {
                                    foreach (Pullenti.Semantic.Utils.DerivateWord w in g.Words)
                                    {
                                        if (w.Lang == v.EndToken.Morph.Language && w.Class.IsVerb && w.Class.IsAdjective)
                                        {
                                            sem.Morph.NormalCase = w.Spelling;
                                            break;
                                        }
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    sem.Typ = Pullenti.Semantic.SemObjectType.Verb;
                }
                if (v.VerbMorph != null && v.VerbMorph.ContainsAttr("возвр.", null))
                {
                    if (sem.Morph.NormalFull.EndsWith("СЯ") || sem.Morph.NormalFull.EndsWith("СЬ"))
                    {
                        sem.Morph.NormalFull = sem.Morph.NormalFull.Substring(0, sem.Morph.NormalFull.Length - 2);
                    }
                }
                List <Pullenti.Semantic.Utils.DerivateGroup> grs = Pullenti.Semantic.Utils.DerivateService.FindDerivates(sem.Morph.NormalFull, true, null);
                if (grs != null && grs.Count > 0)
                {
                    sem.Concept = grs[0];
                    if (v.VerbMorph != null && v.VerbMorph.Misc.Aspect == Pullenti.Morph.MorphAspect.Imperfective)
                    {
                        foreach (Pullenti.Semantic.Utils.DerivateWord w in grs[0].Words)
                        {
                            if (w.Class.IsVerb && !w.Class.IsAdjective)
                            {
                                if (w.Aspect == Pullenti.Morph.MorphAspect.Perfective)
                                {
                                    sem.Morph.NormalFull = w.Spelling;
                                    break;
                                }
                            }
                        }
                    }
                }
                sem.Not = v.Not;
                sems.Add(sem);
                if (attrs.Count > 0)
                {
                    sem.Attrs.AddRange(attrs);
                    attrs.Clear();
                }
                if (adverbs.Count > 0)
                {
                    foreach (Pullenti.Semantic.SemObject a in adverbs)
                    {
                        gr.AddLink(Pullenti.Semantic.SemLinkType.Detail, sem, a, "как", false, null);
                    }
                }
                adverbs.Clear();
            }
            if (sems.Count == 0)
            {
                return(null);
            }
            if (attrs.Count > 0)
            {
                sems[sems.Count - 1].Attrs.AddRange(attrs);
            }
            if (adverbs.Count > 0)
            {
                Pullenti.Semantic.SemObject sem = sems[sems.Count - 1];
                foreach (Pullenti.Semantic.SemObject a in adverbs)
                {
                    gr.AddLink(Pullenti.Semantic.SemLinkType.Detail, sem, a, "как", false, null);
                }
            }
            for (int i = sems.Count - 1; i > 0; i--)
            {
                gr.AddLink(Pullenti.Semantic.SemLinkType.Detail, sems[i - 1], sems[i], "что делать", false, null);
            }
            return(sems[0]);
        }
Esempio n. 5
0
 public static AdverbToken TryParse(Pullenti.Ner.Token t)
 {
     if (t == null)
     {
         return(null);
     }
     if ((t is Pullenti.Ner.TextToken) && (t as Pullenti.Ner.TextToken).Term == "НЕ")
     {
         AdverbToken nn = TryParse(t.Next);
         if (nn != null)
         {
             nn.Not        = true;
             nn.BeginToken = t;
             return(nn);
         }
     }
     Pullenti.Ner.Token t0 = t;
     Pullenti.Ner.Token t1;
     if (t.Next != null && t.Morph.Class.IsPreposition)
     {
         t = t.Next;
     }
     if (t.IsValue("ДРУГ", null) || t.IsValue("САМ", null))
     {
         t1 = t.Next;
         if (t1 != null && t1.Morph.Class.IsPreposition)
         {
             t1 = t1.Next;
         }
         if (t1 != null)
         {
             if (t1.IsValue("ДРУГ", null) && t.IsValue("ДРУГ", null))
             {
                 return new AdverbToken(t0, t1)
                        {
                            Typ = Pullenti.Semantic.SemAttributeType.EachOther
                        }
             }
             ;
             if (t1.IsValue("СЕБЯ", null) && t.IsValue("САМ", null))
             {
                 return new AdverbToken(t0, t1)
                        {
                            Typ = Pullenti.Semantic.SemAttributeType.Himelf
                        }
             }
             ;
         }
     }
     Pullenti.Ner.Core.TerminToken tok = m_Termins.TryParse(t, Pullenti.Ner.Core.TerminParseAttr.No);
     if (tok != null)
     {
         AdverbToken res = new AdverbToken(t0, tok.EndToken)
         {
             Typ = (Pullenti.Semantic.SemAttributeType)tok.Termin.Tag
         };
         t = res.EndToken.Next;
         if (t != null && t.IsComma)
         {
             t = t.Next;
         }
         if (res.Typ == Pullenti.Semantic.SemAttributeType.Less || res.Typ == Pullenti.Semantic.SemAttributeType.Great)
         {
             if (t != null && t.IsValue("ЧЕМ", null))
             {
                 res.EndToken = t;
             }
         }
         return(res);
     }
     Pullenti.Morph.MorphClass mc = t.GetMorphClassInDictionary();
     if (mc.IsAdverb)
     {
         return(new AdverbToken(t, t));
     }
     if (t.IsValue("ВСТРЕЧА", null) && t.Previous != null && t.Previous.IsValue("НА", null))
     {
         AdverbToken ne = TryParse(t.Next);
         if (ne != null && ne.Typ == Pullenti.Semantic.SemAttributeType.EachOther)
         {
             return(new AdverbToken(t.Previous, t));
         }
     }
     return(null);
 }