public ParseResult(ParseInput input, ParseRange range, FacetMoniker facetMoniker, double relevance, bool isSuggestion = false) { if (input == null) { throw new ArgumentNullException("input"); } if (range == null) { throw new ArgumentNullException("range"); } if (facetMoniker == null) { throw new ArgumentNullException("facetMoniker"); } if (relevance < 0 || relevance > 1) { throw new ArgumentOutOfRangeException("relevance", "must be between 0 and 1, inclusive"); } Input = input; Range = range; CompressedRange = input.ToCompressed(Range); FacetMoniker = facetMoniker; Relevance = relevance; IsSuggestion = isSuggestion; }
internal ParseInputTerm(ParseInput input, int ordinal, string text, int startIndex, TermParseMode mode) { Input = input; Ordinal = ordinal; Text = text; TextLower = Text.ToLower(); Mode = mode; _range = new ParseRange(startIndex, text.Length); }
public ParseRange FromCompressed(ParseRange compressedRange) { return(ParseRange.FromIndexes( FromCompressed(compressedRange.StartIndex), FromCompressed(compressedRange.EndIndex))); }
public string GetTextForRange(ParseRange range) { return(Text.Substring(range.StartIndex, range.Length)); }
public ParseRange ToCompressed(ParseRange originalRange) { return(ParseRange.FromIndexes( ToCompressed(originalRange.StartIndex), ToCompressed(originalRange.EndIndex))); }