コード例 #1
0
        public int GetSwiftDay(string text)
        {
            var trimmedText = text.Trim();
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #2
0
        public int GetSwiftMonthOrYear(string text)
        {
            var trimmedText = text.Trim().ToLowerInvariant();
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #3
0
        public int GetSwiftMonthOrYear(string text)
        {
            var trimmedText = text.Trim().Normalized(DateTimeDefinitions.SpecialCharactersEquivalent);
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }

            if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #4
0
        public int GetSwiftMonth(string text)
        {
            var trimmedText = text.Trim().ToLowerInvariant().Normalized();
            var swift       = 0;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }

            if (PastPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }
コード例 #5
0
        public override int GetSwiftYear(string text)
        {
            var trimmedText = text.Trim();
            var swift       = -10;

            if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }
            else if (ThisPrefixRegex.IsMatch(trimmedText))
            {
                swift = 0;
            }

            return(swift);
        }
コード例 #6
0
        public int GetSwiftMonthOrYear(string text)
        {
            var trimmedText = text.Trim();
            var swift       = 0;

            var afterNextMatch = AfterNextPrefixRegex.Match(text);

            if (afterNextMatch.Success)
            {
                swift = 2;
            }
            else if (NextPrefixRegex.IsMatch(trimmedText))
            {
                swift = 1;
            }
            else if (PreviousPrefixRegex.IsMatch(trimmedText))
            {
                swift = -1;
            }

            return(swift);
        }