From 1356311e11ea1d81fdf2bfa2c88ce85a44ca4142 Mon Sep 17 00:00:00 2001 From: FARHAD SHAKERIN Date: Thu, 2 Mar 2023 15:08:29 -0800 Subject: [PATCH] fixing the failing unit test --- .../TimexParsing.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexParsing.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexParsing.cs index aec637fb54..bc2dc0ffb9 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexParsing.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexParsing.cs @@ -51,10 +51,14 @@ private static void ExtractDateTime(string s, TimexProperty timexProperty) var indexOfT = s.IndexOf('T'); var indexOfP = s.IndexOf('P'); + // Spring timex value has a P in it, but should not be mixed up with + // the "period" types that have P in them + var indexOfSP = s.IndexOf("SP"); + if (indexOfT == -1) { var extracted = new Dictionary(); - if (indexOfP == -1) + if (indexOfSP > -1 || indexOfP == -1) { TimexRegex.Extract("date", s, extracted); }