diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimexParsing.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimexParsing.cs index f4a10fe70a..e6c028065d 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimexParsing.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.DataDrivenTests/TestTimexParsing.cs @@ -1094,7 +1094,7 @@ public void DataTypes_Parsing_DurationDays() [TestMethod] public void DataTypes_Parsing_DurationHours() { - var timex = new TimexProperty("PT5H"); + var timex = new TimexProperty("PT5.5H"); CollectionAssert.AreEquivalent(new[] { Constants.TimexTypes.Duration }, timex.Types.ToList()); Assert.IsNull(timex.Year); @@ -1113,7 +1113,7 @@ public void DataTypes_Parsing_DurationHours() Assert.IsNull(timex.Months); Assert.IsNull(timex.Weeks); Assert.IsNull(timex.Days); - Assert.AreEqual(5, timex.Hours); + Assert.AreEqual(5.5m, timex.Hours); Assert.IsNull(timex.Minutes); Assert.IsNull(timex.Seconds); Assert.IsNull(timex.Now); @@ -1122,7 +1122,7 @@ public void DataTypes_Parsing_DurationHours() [TestMethod] public void DataTypes_Parsing_DurationMinutes() { - var timex = new TimexProperty("PT30M"); + var timex = new TimexProperty("PT30.5M"); CollectionAssert.AreEquivalent(new[] { Constants.TimexTypes.Duration }, timex.Types.ToList()); Assert.IsNull(timex.Year); @@ -1142,7 +1142,7 @@ public void DataTypes_Parsing_DurationMinutes() Assert.IsNull(timex.Weeks); Assert.IsNull(timex.Days); Assert.IsNull(timex.Hours); - Assert.AreEqual(30, timex.Minutes); + Assert.AreEqual(30.5m, timex.Minutes); Assert.IsNull(timex.Seconds); Assert.IsNull(timex.Now); } @@ -1150,7 +1150,7 @@ public void DataTypes_Parsing_DurationMinutes() [TestMethod] public void DataTypes_Parsing_DurationSeconds() { - var timex = new TimexProperty("PT45S"); + var timex = new TimexProperty("PT45.5S"); CollectionAssert.AreEquivalent(new[] { Constants.TimexTypes.Duration }, timex.Types.ToList()); Assert.IsNull(timex.Year); @@ -1171,7 +1171,7 @@ public void DataTypes_Parsing_DurationSeconds() Assert.IsNull(timex.Days); Assert.IsNull(timex.Hours); Assert.IsNull(timex.Minutes); - Assert.AreEqual(45, timex.Seconds); + Assert.AreEqual(45.5m, timex.Seconds); Assert.IsNull(timex.Now); } } diff --git a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexProperty.cs b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexProperty.cs index 266d7a0189..d52e2d58c9 100644 --- a/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexProperty.cs +++ b/.NET/Microsoft.Recognizers.Text.DataTypes.TimexExpression/TimexProperty.cs @@ -259,15 +259,15 @@ public void AssignProperties(IDictionary source) break; case "hourAmount": - Hours = int.Parse(item.Value, CultureInfo.InvariantCulture); + Hours = decimal.Parse(item.Value, CultureInfo.InvariantCulture); break; case "minuteAmount": - Minutes = int.Parse(item.Value, CultureInfo.InvariantCulture); + Minutes = decimal.Parse(item.Value, CultureInfo.InvariantCulture); break; case "secondAmount": - Seconds = int.Parse(item.Value, CultureInfo.InvariantCulture); + Seconds = decimal.Parse(item.Value, CultureInfo.InvariantCulture); break; } }