コード例 #1
0
        public ParserEventStream(IObjectStream<Parse> d, AbstractHeadRules rules, ParserEventTypeEnum type)
            : base(d, rules, type) {

            buildContextGenerator = new BuildContextGenerator();
            attachContextGenerator = new AttachContextGenerator(Punctuation);
            checkContextGenerator = new CheckContextGenerator(Punctuation);
        }
コード例 #2
0
        /// <summary>
        /// Create an event stream based on the specified data stream of the specified type using the specified head rules.
        /// </summary>
        /// <param name="samples">A 1-parse-per-line Penn Treebank Style parse.</param>
        /// <param name="rules">The head rules.</param>
        /// <param name="eType">The type of events desired (tag, chunk, build, or check).</param>
        /// <param name="dictionary">A tri-gram dictionary to reduce feature generation.</param>
        public ParserEventStream(IObjectStream<Parse> samples, AbstractHeadRules rules, ParserEventTypeEnum eType,
            Dictionary.Dictionary dictionary)
            : base(samples, rules, eType, dictionary) {

            switch (eType) {
                case ParserEventTypeEnum.Build:
                    bcg = new BuildContextGenerator(dictionary);
                    break;
                case ParserEventTypeEnum.Check:
                    kcg = new CheckContextGenerator();
                    break;
            }

        }
コード例 #3
0
        protected AbstractParserEventStream(
            IObjectStream <Parse> samples,
            IHeadRules headRules,
            ParserEventTypeEnum type,
            Dictionary.Dictionary dictionary) : base(samples)
        {
            Rules         = headRules;
            Punctuation   = headRules.PunctuationTags;
            Dictionary    = dictionary;
            FixPossesives = false;

            Type = type;

            switch (type)
            {
            case ParserEventTypeEnum.Chunk:
                chunkerContextGenerator = new ChunkContextGenerator();
                break;

            case ParserEventTypeEnum.Tag:
                posContextGenerator = new DefaultPOSContextGenerator(null);
                break;
            }
        }
コード例 #4
0
ファイル: ParserEventStream.cs プロジェクト: qooba/SharpNL
        /// <summary>
        /// Create an event stream based on the specified data stream of the specified type using the specified head rules.
        /// </summary>
        /// <param name="samples">A 1-parse-per-line Penn Treebank Style parse.</param>
        /// <param name="rules">The head rules.</param>
        /// <param name="eType">The type of events desired (tag, chunk, build, or check).</param>
        /// <param name="dictionary">A tri-gram dictionary to reduce feature generation.</param>
        public ParserEventStream(IObjectStream <Parse> samples, AbstractHeadRules rules, ParserEventTypeEnum eType,
                                 Dictionary.Dictionary dictionary)
            : base(samples, rules, eType, dictionary)
        {
            switch (eType)
            {
            case ParserEventTypeEnum.Build:
                bcg = new BuildContextGenerator(dictionary);
                break;

            case ParserEventTypeEnum.Check:
                kcg = new CheckContextGenerator();
                break;
            }
        }
コード例 #5
0
ファイル: ParserEventStream.cs プロジェクト: qooba/SharpNL
 /// <summary>
 /// Create an event stream based on the specified data stream of the specified type using the specified head rules.
 /// </summary>
 /// <param name="samples">A 1-parse-per-line Penn Treebank Style parse.</param>
 /// <param name="rules">The head rules.</param>
 /// <param name="eType">The type of events desired (tag, chunk, build, or check).</param>
 public ParserEventStream(IObjectStream <Parse> samples, AbstractHeadRules rules, ParserEventTypeEnum eType)
     : this(samples, rules, eType, null)
 {
 }
コード例 #6
0
 /// <summary>
 /// Create an event stream based on the specified data stream of the specified type using the specified head rules.
 /// </summary>
 /// <param name="samples">A 1-parse-per-line Penn Treebank Style parse.</param>
 /// <param name="rules">The head rules.</param>
 /// <param name="eType">The type of events desired (tag, chunk, build, or check).</param>
 public ParserEventStream(IObjectStream<Parse> samples, AbstractHeadRules rules, ParserEventTypeEnum eType)
     : this(samples, rules, eType, null) {}