Skip to content

Commit 20ed03f

Browse files
authored
Merge pull request #833 from clulab/kwalcock/v10debugger
Add debugger subproject to v10
2 parents 7a8763e + d7b5846 commit 20ed03f

File tree

124 files changed

+5962
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+5962
-257
lines changed

build.sbt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1+
// These were last checked on 2025-02-19.
12
val scala211 = "2.11.12" // up to 2.11.12
2-
val scala212 = "2.12.19" // up to 2.12.19
3-
val scala213 = "2.13.14" // up to 2.13.14
3+
val scala212 = "2.12.19" // up to 2.12.20
4+
val scala213 = "2.13.14" // up to 2.13.16
45
val scala30 = "3.0.2" // up to 3.0.2
56
val scala31 = "3.1.3" // up to 3.1.3
67
val scala32 = "3.2.2" // up to 3.2.2
7-
val scala33 = "3.3.3" // up to 3.3.3
8-
val scala34 = "3.4.2" // up to 3.4.2
9-
10-
val scala3 = scala31
8+
val scala33 = "3.3.5" // up to 3.3.5 (LTS)
9+
val scala34 = "3.4.3" // up to 3.4.3
10+
val scala35 = "3.5.2" // up to 3.5.2
11+
val scala36 = "3.6.3" // up to 3.6.3
1112

1213
// See https://www.scala-lang.org/blog/2022/08/17/long-term-compatibility-plans.html.
1314
// Scala30: "If you are maintaining a library, you should drop Scala 3.0." Dropped.
1415
// Scala31: This is a LTS (long term support) version before it was called that.
1516
// Scala32: This is for experimentation, as in Scala Next, and not for release.
1617
// Scala33: This is the first official LTS, but hold off until necessary.
18+
val scala3 = scala31
19+
1720
ThisBuild / crossScalaVersions := Seq(scala212, scala211, scala213, scala3)
1821
ThisBuild / scalaVersion := crossScalaVersions.value.head
1922

2023
lazy val root = (project in file("."))
2124
// Skip webapp because it only works for particular Scala versions.
2225
// It needs to be released separately (if at all).
23-
.aggregate(library, apps)
26+
.aggregate(library, apps, debugger)
2427
.settings(
2528
publish / skip := true
2629
)
@@ -42,4 +45,7 @@ lazy val webapp = project
4245
crossScalaVersions := Seq(scala212)
4346
)
4447

48+
lazy val debugger = project
49+
.dependsOn(library % "compile -> compile; test -> test")
50+
4551
addCommandAlias("dockerizeWebapp", ";webapp/docker:publishLocal")

debugger/build.sbt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name := "processors-debugger"
2+
description := "A debugger for the Odin ExtractionEngine within processors"
3+
4+
libraryDependencies ++= {
5+
Seq(
6+
"com.lihaoyi" %% "scalatags" % "0.12.0", // as of 2025-02-19 up to 0.13.1
7+
"com.lihaoyi" %% "sourcecode" % "0.3.0", // as of 2025-01-27 up to 0.4.2
8+
9+
"org.clulab" % "processors-model" % "0.3.1"
10+
)
11+
}

debugger/publish.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Compile / packageBin / mainClass := None
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cake
2+
pizza
3+
burger
4+
pain au chocolat
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- name: foods-from-lexicon
2+
priority: ${rulepriority}
3+
label: Food
4+
type: token
5+
pattern: |
6+
[entity='B-FOOD'] [entity='I-FOOD']+
7+
8+
- name: person-from-lexicon
9+
priority: ${rulepriority}
10+
label: Person
11+
type: token
12+
pattern: |
13+
[entity='B-PER'] [entity='I-PER']*
14+
15+
- name: more-foods-from-lexicon
16+
priority: ${rulepriority}
17+
label: Food
18+
type: token
19+
pattern: |
20+
(?<= hello there) [entity='B-FOOD'] [entity='I-FOOD']* @theme:Person $
21+
22+
- name: more-person-from-lexicon
23+
priority: ${rulepriority}
24+
label: Person
25+
type: token
26+
pattern: |
27+
^ @theme:Food [entity='B-PER'] [entity='I-PER']* (?= goodbye)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
- name: people-eat-food
3+
priority: ${rulepriority}
4+
label: Eating
5+
example: "John eats cake"
6+
graph: "hybrid"
7+
pattern: |
8+
trigger = [lemma=/eat/ & tag=/^V/]
9+
food:Food = dobj
10+
person:Person = nsubj
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
taxonomy:
3+
- Entity:
4+
- Food
5+
- Person
6+
- Event:
7+
- Eating
8+
9+
rules:
10+
- import: org/clulab/odin/debugger/entities.yml
11+
vars:
12+
# We need our entities before we can match events
13+
# Here we make use of the ${rulepriority} variable
14+
# used in the entities.yml rules
15+
rulepriority: "1"
16+
17+
- import: org/clulab/odin/debugger/events.yml
18+
vars:
19+
rulepriority: "2"

0 commit comments

Comments
 (0)