Skip to content

Commit

Permalink
[modify] in str2cls, replace input
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke Oi authored and Yusuke Oi committed Jan 3, 2020
1 parent 6f95596 commit cad714a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/scala/netkeiba-scraper/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit cad714a

Please sign in to comment.