Skip to content

Commit

Permalink
Merge pull request #7 from oichan/patch-oichan
Browse files Browse the repository at this point in the history
[modify] in str2cls, replace input
  • Loading branch information
stockedge authored Dec 14, 2021
2 parents 9dc6f6d + cad714a commit 81fed37
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 81fed37

Please sign in to comment.