예제 #1
0
        private static void ExtractDuration(string s, TimexProperty obj)
        {
            var extracted = new Dictionary <string, string>();

            TimexRegex.Extract("period", s, extracted);
            obj.AssignProperties(extracted);
        }
예제 #2
0
        private static void ExtractDateTime(string s, TimexProperty obj)
        {
            var indexOfT = s.IndexOf('T');

            if (indexOfT == -1)
            {
                var extracted = new Dictionary <string, string>();
                TimexRegex.Extract("date", s, extracted);
                obj.AssignProperties(extracted);
            }
            else
            {
                var extracted = new Dictionary <string, string>();
                TimexRegex.Extract("date", s.Substring(0, indexOfT), extracted);
                TimexRegex.Extract("time", s.Substring(indexOfT), extracted);
                obj.AssignProperties(extracted);
            }
        }