You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maria (Masha) Alexeeva edited this page Dec 19, 2021
·
4 revisions
The current testing framework supports testing extractions of mentions with two arguments (e.g., Variable-Definition and Variable-Value) as well as one type of three argument mention (Variable-MinValue-MaxValue), and can be found here.
A test consists of the text value to extract mentions from, the statement of what the test is supposed to find, a sequence that contains the desired extractions, the extraction of mentions, and running the test:
val t1b = "In APSIM, water uptake (Ta, mm d−1) is determined from potential transpiration demand (Tp, mm d−1), soil " +
"water available (WA, mm d−1), and water supply (WS, mm d−1) for each ith day and soil layer as:"
passingTest should s"find definitions from t1b: ${t1b}" taggedAs(Somebody) in {
val desired = Seq(
"Ta" -> Seq("water uptake"),
"Tp" -> Seq("potential transpiration demand"),
"WA" -> Seq("soil water available"),
"WS" -> Seq("water supply")
)
val mentions = extractMentions(t1b)
testDefinitionEvent(mentions, desired)
}
The full battery of tests currently implemented can be found here.