From 36a7f4d527ccbaf44a9aca0c37d10c1aeb4399b3 Mon Sep 17 00:00:00 2001 From: Neville Li Date: Mon, 8 Jan 2018 12:32:58 -0500 Subject: [PATCH] update NGrams preconditions --- .../main/scala/com/spotify/featran/transformers/NGrams.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/com/spotify/featran/transformers/NGrams.scala b/core/src/main/scala/com/spotify/featran/transformers/NGrams.scala index 0a520c5a..f4a5b37b 100644 --- a/core/src/main/scala/com/spotify/featran/transformers/NGrams.scala +++ b/core/src/main/scala/com/spotify/featran/transformers/NGrams.scala @@ -45,7 +45,7 @@ object NGrams { def apply(name: String, low: Int = 1, high: Int = -1, sep: String = " ") : Transformer[Seq[String], Set[String], SortedMap[String, Int]] = { require(low > 0, "low must be > 0") - require(high > 0 || high == -1, "high must > 0 or -1") + require(high >= low || high == -1, "high must >= low or -1") new NGrams(name, low, high, sep) } }