コード例 #1
0
ファイル: CatEntry.cs プロジェクト: russellcaughey/simplenlg
 public CatEntry(string cat)
 {
     if (cat.Equals("verb"))
     {
         verbEntry_ = new VerbEntry();
     }
     else if (cat.Equals("noun"))
     {
         nounEntry_ = new NounEntry();
     }
     else if (cat.Equals("adj"))
     {
         adjEntry_ = new AdjEntry();
     }
     else if (cat.Equals("adv"))
     {
         advEntry_ = new AdvEntry();
     }
     else if (cat.Equals("aux"))
     {
         auxEntry_ = new AuxEntry();
     }
     else if (cat.Equals("modal"))
     {
         modalEntry_ = new ModalEntry();
     }
     else if (cat.Equals("pron"))
     {
         pronEntry_ = new PronEntry();
     }
     else if (cat.Equals("det"))
     {
         detEntry_ = new DetEntry();
     }
 }
コード例 #2
0
        /**
         * extract adj information from NIH AdjEntry record, and add to a simplenlg
         * WordElement For now just extract position info
         *
         * @param wordElement
         * @param AdjEntry
         */
        private void addAdjectiveInfo(WordElement wordElement, AdjEntry adjEntry)
        {
            bool          qualitativeAdj = false;
            bool          colourAdj      = false;
            bool          classifyingAdj = false;
            bool          predicativeAdj = false;
            List <string> positions      = adjEntry.GetPosition();

            foreach (string position in positions)
            {
                if (position.StartsWith("attrib(1)", StringComparison.Ordinal))
                {
                    qualitativeAdj = true;
                }
                else if (position.StartsWith("attrib(2)", StringComparison.Ordinal))
                {
                    colourAdj = true;
                }
                else if (position.StartsWith("attrib(3)", StringComparison.Ordinal))
                {
                    classifyingAdj = true;
                }
                else if (position.StartsWith("pred", StringComparison.Ordinal))
                {
                    predicativeAdj = true;
                }
                // ignore other positions
            }
            // ignore (for now) other info in record
            wordElement.setFeature(LexicalFeature.QUALITATIVE, qualitativeAdj);
            wordElement.setFeature(LexicalFeature.COLOUR, colourAdj);
            wordElement.setFeature(LexicalFeature.CLASSIFYING, classifyingAdj);
            wordElement.setFeature(LexicalFeature.PREDICATIVE, predicativeAdj);
        }
コード例 #3
0
        public CatEntryGJdV(LexRecord lexRecord)

        {
            string cat = lexRecord.GetCategory();

            if (cat.Equals("verb"))

            {
                verbEntry_ = new VerbEntry(lexRecord);
            }
            else if (cat.Equals("noun"))

            {
                nounEntry_ = new NounEntry(lexRecord);
            }
            else if (cat.Equals("adj"))

            {
                adjEntry_ = new AdjEntry(lexRecord);
            }
            else if (cat.Equals("adv"))

            {
                advEntry_ = new AdvEntry(lexRecord);
            }
            else if (cat.Equals("aux"))

            {
                auxEntry_ = new AuxEntry(lexRecord);
            }
            else if (cat.Equals("modal"))

            {
                modalEntry_ = new ModalEntry(lexRecord);
            }
            else if (cat.Equals("pron"))

            {
                pronEntry_ = new PronEntry(lexRecord);
            }
            else if (cat.Equals("det"))

            {
                detEntry_ = new DetEntry(lexRecord);
            }
        }