/// <summary>
        /// Verifies if the text qualifies as a valid floating number.
        /// </summary>
        /// <param name="text">text to verify</param>
        /// <returns>returns true if the text has qualified as a valid floating number</returns>
        public static bool IsValidFloatingNumber(this ISegment segment, params char[] separators)
        {
            var text = segment.GetString(false);

            if (string.IsNullOrEmpty(text))
            {
                return(true);
            }

            return(NumberTokenHelper.IsValidFloating(text));
        }
예제 #2
0
        /// <summary>
        /// Verifies if the text qualifies as a valid floating number.
        /// </summary>
        /// <param name="text">text to verify</param>
        /// <returns>returns true if the text has qualified as a valid floating number</returns>
        public static bool IsValidFloatingNumber(this ISegment segment, params char[] separators)
        {
            var text = segment.GetString(false);

            return(NumberTokenHelper.IsValidFloating(text));
        }
예제 #3
0
        public static int GetSegmentEditDistance(this ISegment segment, string replacementText)
        {
            var textSegment = segment.GetString();

            return(LevenshteinDistance.Calculate(textSegment, replacementText));
        }