Home

Awesome

Test Rules

Test rules are made to verify that your implementation of SRL is valid. These files contain simple tests to validate the SRL and the corresponding results. The structure is easy to understand and implement.

Structure of a .rule File

These rules are required to build valid test rules:

Example .rule Files

# This is a sample rule with a named capture group
srl: capture (letter twice) as "foo"
capture for "aa1":
- 0: foo: "aa"
match: "example"
match: "aa2"
no match: "a"
# This is a sample rule with an anonymous capture group and multiple results
srl: capture (digit)
capture for "123":
- 0: 0: "1"
- 1: 0: "2"
- 2: 0: "3"

capture for "01":
- 0: 0: "0"
- 1: 0: "1"