コード例 #1
0
ファイル: TreeBuilder.cs プロジェクト: vasmanas/Searcher
        public TreePart Create(TreePart t, string value)
        {
            if (t is null)
            {
                if (string.IsNullOrEmpty(value))
                {
                    return(new TreePartEndOf());
                }
                else
                {
                    return(this.Create(new TreePartCondition(value[0]), value));
                }
            }

            return(this.Create((dynamic)t, value));
        }
コード例 #2
0
        public SlidingSearch(IEnumerable <string> keywords)
        {
            this._conditionTree = null;

            var builder = new TreeBuilder();

            foreach (var keyword in keywords)
            {
                if (string.IsNullOrEmpty(keyword))
                {
                    continue;
                }

                this._conditionTree = builder.Create(this._conditionTree, keyword);
            }
        }