From cad714a7e462513ec3092408d548eb8af178a5d5 Mon Sep 17 00:00:00 2001 From: Yusuke Oi Date: Fri, 3 Jan 2020 22:53:03 +0900 Subject: [PATCH] [modify] in str2cls, replace input --- src/main/scala/netkeiba-scraper/Main.scala | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/scala/netkeiba-scraper/Main.scala b/src/main/scala/netkeiba-scraper/Main.scala index 1f8bc25..581eb6e 100644 --- a/src/main/scala/netkeiba-scraper/Main.scala +++ b/src/main/scala/netkeiba-scraper/Main.scala @@ -1850,8 +1850,17 @@ object Util { def str2cls(s: String): Int = { str2clsMap.foreach{ case (a, b) => - if (s.contains(a)) return b } - sys.error("class not found:"+s) + if (failcls2safe(s).contains(a)) return b } + sys.error("class not found:"+failcls2safe(s)) + } + + def failcls2safe(s: String): String = { + s match { + case s if s.contains("3歳以上1勝クラス") => s + "500万下" + case s if s.contains("2歳1勝クラス") => s + "500万下" + case s if s.contains("3歳以上2勝クラス") => s + "1000万下" + case _ => s + } } val positionState =