コード例 #1
0
        /// <summary>Call this method to get a String array of categories to split on.</summary>
        /// <remarks>
        /// Call this method to get a String array of categories to split on.
        /// It calculates parent annotation statistics suitable for doing
        /// selective parent splitting in the PCFGParser inside
        /// FactoredParser.  <p>
        /// If tlp is non-null tlp.basicCategory() will be called on parent and
        /// grandparent nodes. <p>
        /// <i>Implementation note:</i> This method is not designed for concurrent
        /// invocation: it uses static state variables.
        /// </remarks>
        public static ICollection <string> GetSplitCategories(Treebank t, bool doTags, int algorithm, double phrasalCutOff, double tagCutOff, ITreebankLanguagePack tlp)
        {
            Edu.Stanford.Nlp.Parser.Lexparser.ParentAnnotationStats pas = new Edu.Stanford.Nlp.Parser.Lexparser.ParentAnnotationStats(tlp, doTags);
            t.Apply(pas);
            ICollection <string> splitters = Generics.NewHashSet();

            Edu.Stanford.Nlp.Parser.Lexparser.ParentAnnotationStats.GetSplitters(phrasalCutOff, pas.nodeRules, pas.pRules, pas.gPRules, splitters);
            Edu.Stanford.Nlp.Parser.Lexparser.ParentAnnotationStats.GetSplitters(tagCutOff, pas.tagNodeRules, pas.tagPRules, pas.tagGPRules, splitters);
            return(splitters);
        }