protected override NumberRange GetNumberRange(Match match, UnitCoderBase coder) { NumberRange result = new NumberRange(); result.End = new NumberValue(GetNumber(match.Groups["end"], coder).Value); Group startGroup = match.Groups["from"]; if (startGroup.Success) { result.Start = new NumberValue(GetNumber(match.Groups["start"], coder).Value); } return(result); }
protected override NumberRange GetNumberRange(Match match, UnitCoderBase coder) { var number = new NumberValue(GetNumber(match.Groups["number"], coder).Value); NumberRange result = new NumberRange(); if (match.Groups["great"].Success) { result.Start = number; } else { result.End = number; } return(result); }
public TextRange(NumberRange range, string leftContext, string rightContext) { Range = range; LeftContext = leftContext; RightContext = rightContext; }
public TextRange(NumberRange range, IEnumerable <UnitTextBase> units, int contextLength) { Range = range; LeftContext = GetLeftContext(units, range.StartPosition, contextLength); RightContext = GetRightContext(units, range.EndPosition, contextLength); }