示例#1
0
 public void MarkPunctuation(params string[] symbols)
 {
     foreach (string symbol in symbols)
     {
         KeyTerm term = ToTerm(symbol);
         term.SetFlag(TermFlags.IsPunctuation | TermFlags.NoAstNode);
     }
 }
示例#2
0
        public KeyTerm ToTerm(string text, string name)
        {
            KeyTerm term;

            if (KeyTerms.TryGetValue(text, out term))
            {
                //update name if it was specified now and not before
                if (string.IsNullOrEmpty(term.Name) && !string.IsNullOrEmpty(name))
                {
                    term.Name = name;
                }
                return(term);
            }
            //create new term
            if (!CaseSensitive)
            {
                text = text.ToLowerInvariant();
            }
            text           = string.Intern(text);
            term           = new KeyTerm(text, name);
            KeyTerms[text] = term;
            return(term);
        }