diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-11-03 14:56:11 +0000 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-11-03 14:56:11 +0000 |
commit | efcc56381d7ebcd12bb0a9836351ae20dc10d334 (patch) | |
tree | f7dba28f593d695fd64c7289e526c78bfcac9ee6 /src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala | |
parent | 47a89f67f4acdbd55fd1cbfb704211937962e522 (diff) | |
download | RSAComb-efcc56381d7ebcd12bb0a9836351ae20dc10d334.tar.gz RSAComb-efcc56381d7ebcd12bb0a9836351ae20dc10d334.zip |
Add option to specify the approximation algorithm from the CLI
Diffstat (limited to 'src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala')
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala index 4d96850..3e92d81 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAConfig.scala | |||
@@ -18,6 +18,7 @@ package uk.ac.ox.cs.rsacomb | |||
18 | 18 | ||
19 | import scala.collection.mutable.Map | 19 | import scala.collection.mutable.Map |
20 | import util.Logger | 20 | import util.Logger |
21 | import approximation._ | ||
21 | 22 | ||
22 | case class RSAOption[+T](opt: T) { | 23 | case class RSAOption[+T](opt: T) { |
23 | def get[T]: T = opt.asInstanceOf[T] | 24 | def get[T]: T = opt.asInstanceOf[T] |
@@ -116,6 +117,13 @@ object RSAConfig { | |||
116 | } | 117 | } |
117 | case flag @ ("-a" | "--answers") :: answers :: tail => | 118 | case flag @ ("-a" | "--answers") :: answers :: tail => |
118 | parse(tail, config += ('answers -> getPath(answers))) | 119 | parse(tail, config += ('answers -> getPath(answers))) |
120 | case flag @ ("-x" | "--approximation") :: _approx :: tail => { | ||
121 | val approx = _approx match { | ||
122 | case "lowerbound" => new Lowerbound | ||
123 | case "upperbound" => new Upperbound | ||
124 | } | ||
125 | parse(tail, config += ('approximation -> approx)) | ||
126 | } | ||
119 | case flag @ ("-q" | "--queries") :: _query :: tail => { | 127 | case flag @ ("-q" | "--queries") :: _query :: tail => { |
120 | val query = getPath(_query) | 128 | val query = getPath(_query) |
121 | if (!os.isFile(query)) | 129 | if (!os.isFile(query)) |
@@ -149,6 +157,8 @@ object RSAConfig { | |||
149 | exit("The following flag is mandatory: '-o' or '--ontology'.") | 157 | exit("The following flag is mandatory: '-o' or '--ontology'.") |
150 | if (!config.contains('data)) | 158 | if (!config.contains('data)) |
151 | config += ('data -> List.empty[os.Path]) | 159 | config += ('data -> List.empty[os.Path]) |
160 | if (!config.contains('approximation)) | ||
161 | config += ('approximation -> new Lowerbound) | ||
152 | config | 162 | config |
153 | } | 163 | } |
154 | } | 164 | } |