Skip to content

Commit

Permalink
for scala 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
EgoLaparra committed Jan 4, 2019
1 parent 6f4c630 commit dda21ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.12.2</scala.version>
<scala.version.short>2.12</scala.version.short>
<scala.version>2.11.11</scala.version>
<scala.version.short>2.11</scala.version.short>
</properties>

<dependencies>
Expand Down Expand Up @@ -88,7 +88,7 @@

<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-json_2.12</artifactId>
<artifactId>play-json_2.11</artifactId>
<version>2.6.9</version>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/clulab/timenorm/TimeNormScorer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ object TimeNormScorer {
}
object Timex {
def allFrom(reader: AnaforaReader)(implicit data: Data): Seq[Timex] = {
data.topEntities.filter(e => !skip.contains(e.`type`)).flatMap(e =>
Try(Timex(e.id, e.fullSpan, reader.temporal(e))).fold(ex => {ex.printStackTrace(); Seq.empty}, ts => Seq(ts)))
data.topEntities.filter(e => !skip.contains(e.`type`)).map(e =>
Try(Timex(e.id, e.fullSpan, reader.temporal(e))).get)
}
def allIntervalsFrom(reader: AnaforaReader)(implicit data: Data): Seq[Timex] = {
allFrom(reader)(data).filter(t => Try(intervals(t.time).size > 0 && intervals(t.time).forall(i => i.isDefined)).getOrElse(false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object WordToNumber {
"billion" -> 1000000000L,
"trillion" -> 1000000000000L,
"quadrillion" -> 1000000000000000L,
"quintillion" -> 1000000000000000000L,
"quintillion" -> 1000000000000000000L
// "sextillion" -> 1000000000000000000000L,
// "septillion" -> 1000000000000000000000000L,
// "octillion" -> 1000000000000000000000000000L,
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/org/clulab/timenorm/TimeNormScorerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ class TimeNormScorerTest extends FunSuite with TypesSuite {
val goldTimexes = Seq(
Timex("G1", (0, 3), SimpleInterval.of(1980, 5)),
Timex("G2", (5, 10), SimpleInterval.of(1985, 2, 1)),
Timex("G3", (11, 12), SimpleInterval.of(1985, 2, 2)),
Timex("G3", (11, 12), SimpleInterval.of(1985, 2, 2))
)
val systemTimexes = Seq(
Timex("S1", (0, 1), SimpleInterval.of(1980, 5, 1)),
Timex("S2", (2, 3), SimpleInterval.of(1980, 5, 31)),
Timex("S3", (3, 5), SimpleInterval.of(1980, 5)),
Timex("S4", (9, 12), SimpleInterval.of(1985, 2)),
Timex("S4", (9, 12), SimpleInterval.of(1985, 2))
)
val (precisions, recalls) = intervalScores(goldTimexes, systemTimexes)
assert(precisions === Seq(1.0, 1.0, 0.0, 2/28.0))
Expand Down

0 comments on commit dda21ef

Please sign in to comment.