Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Conversion/Scanners/BaseScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class BaseScanner
public static string NumberRegex = "((?:(?:\\.|,)?\\d+(?:[\\.,\\s]\\d+)*(?:(?:\\.|,)\\d+)?))";

//Omitting front slash from here because we dont want it to catch fractions
public static string WordSeparatorRegex = "[<>.,;:\\-_!#¤&()=?`@{}+´¨~*'\"]";
public static string WordSeparatorRegex = "[<>.,;:\\-_!#¤&()=?`@{}+´¨~*'\"\\/]";

public static bool Parse(string str, out double amount)
{
Expand Down
5 changes: 5 additions & 0 deletions Tests/Conversion/Scanners/SingleRegexScannerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public void Tests()
(4, "l", 1),
(60.0, "g", 1)
}),
("Our 25.4lbs/11.5kg recent rescue Oliver.", new[]
{
(25.4, "lbs", 3),
(11.5, "kg", 3)
})
};

ScannerUtils.Test(new SingleRegexScanner(), strs, (expected, actual) =>
Expand Down
1 change: 0 additions & 1 deletion Tests/TextAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public void NoCascades()
[DataRow("But a \"quote that happens to end with 12\" should not work", null, false)]
[DataRow("A phrase with a \"quote\" and also a 12\" should work", "12\" ≈ 30.5 centimetres", false)]
[DataRow("A phrase with a \"quote\" and also a 12\" should work, even with \"quotes\" after", "12\" ≈ 30.5 centimetres", false)]
[DataRow("A phrase with a \"quote\" and also a 12\" should work, even with \"quotes\" and /1\" after", "12\" ≈ 30.5 centimetres", false)]
public void ConvertSingle(string input, string expected, bool novelty)
{
var results = (novelty ? _noveltyAnalyzer : _regularAnalyzer).FindConversions(input);
Expand Down