示例#1
0
        public LexicalCategory GetSimpleNLGCategory(LexRecord record)
        {
            string cat = GetCategory();

            LexicalCategory.LexicalCategoryEnum catEnum = LexicalCategory.LexicalCategoryEnum.ANY;
            if (cat == null)
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.ANY;
            }
            else if (cat.Equals("noun", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.NOUN;
            }
            else if (cat.Equals("verb", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.VERB;
            }
            else if (cat.Equals("aux", StringComparison.CurrentCultureIgnoreCase) &&
                     record.GetBase().Equals("be", StringComparison.CurrentCultureIgnoreCase))    // return aux "be"
            // as a VERB
            // not needed for other aux "have" and "do", they have a verb entry
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.VERB;
            }
            else if (cat.Equals("adj", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.ADJECTIVE;
            }
            else if (cat.Equals("adv", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.ADVERB;
            }
            else if (cat.Equals("pron", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.PRONOUN;
            }
            else if (cat.Equals("det", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.DETERMINER;
            }
            else if (cat.Equals("prep", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.PREPOSITION;
            }
            else if (cat.Equals("conj", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.CONJUNCTION;
            }
            else if (cat.Equals("compl", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.COMPLEMENTISER;
            }
            else if (cat.Equals("modal", StringComparison.CurrentCultureIgnoreCase))
            {
                catEnum = LexicalCategory.LexicalCategoryEnum.MODAL;
            }

            return(new LexicalCategory(catEnum));
        }
示例#2
0
 public virtual void SetLexRecord(LexRecord lexRecord)
 {
     base_          = lexRecord.GetBase();
     spellingVars_  = lexRecord.GetSpellingVars();
     eui_           = lexRecord.GetEui();
     category_      = lexRecord.GetCategory();
     catEntry_      = lexRecord.GetCatEntry();
     acronyms_      = lexRecord.GetAcronyms();
     abbreviations_ = lexRecord.GetAbbreviations();
     annotations_   = lexRecord.GetAnnotations();
     signature_     = lexRecord.GetSignature();
     end_           = lexRecord.GetEnd();
 }