From 33de4e1a13a34411e7826ecdc6f3cc90a76504eb Mon Sep 17 00:00:00 2001 From: John Bauer Date: Wed, 26 Feb 2025 20:02:42 -0800 Subject: [PATCH] doesn't work yet --- .../nlp/semgraph/semgrex/SemgrexTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java b/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java index 3c2b785f34..e19e27d007 100644 --- a/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java +++ b/test/src/edu/stanford/nlp/semgraph/semgrex/SemgrexTest.java @@ -222,6 +222,21 @@ public void testNegatedRegex() { "ate", "blueberry"); } + public void testBrokenContainsExpression() { + try { + // word is a String, not a Map, so this should throw a parse exception + SemgrexPattern pattern = SemgrexPattern.compile("{word@foo=bar}"); + throw new AssertionError("Expected a SemgrexParseException"); + } catch (SemgrexParseException e) { + // good + } + } + + public void testContainsExpression() { + // morphofeatures is a Map, so this should work + //SemgrexPattern pattern = SemgrexPattern.compile("{morphofeatures@foo=bar}"); + } + public void testReferencedRegex() { runTest("{word:/Bill/}", "[ate subj>Bill obj>[bill det>the]]", "Bill");