|
158 | 158 | Qfeat4 = "EDIT feat WHERE subset = \"strength\" AND class = \"strong\" WITH class \"verystrong\" FOR ID \"WR-P-E-J-0000000001.text.sentiment.1\""
|
159 | 159 |
|
160 | 160 | Qdelete_correction = "DELETE correction ID \"correctionexample.s.1.w.2.correction.1\" RESTORE ORIGINAL RETURN ancestor-focus"
|
| 161 | +Qdelete_structural_correction = "DELETE correction ID \"correctionexample.s.3.correction.1\" RESTORE ORIGINAL RETURN ancestor-focus" |
| 162 | +Qdelete_structural_correction2 = "DELETE correction ID \"correctionexample.s.3.correction.2\" RESTORE ORIGINAL RETURN ancestor-focus" |
161 | 163 |
|
162 | 164 |
|
163 | 165 | class Test1UnparsedQuery(unittest.TestCase):
|
@@ -973,6 +975,24 @@ def test4_delete_correction(self):
|
973 | 975 | self.assertIsInstance(results[0], folia.Word)
|
974 | 976 | self.assertEqual(results[0].text(), "word")
|
975 | 977 |
|
| 978 | + def test4b_delete_structural_correction(self): |
| 979 | + """Deleting a structural correction and restoring the original (runon error)""" |
| 980 | + q = fql.Query(Qdelete_structural_correction) |
| 981 | + results = q(self.doc) |
| 982 | + self.assertIsInstance(results[0], folia.Sentence) |
| 983 | + self.assertIsInstance(results[0][0], folia.Word) |
| 984 | + self.assertEqual(results[0][0].text(), "Ikhoor") |
| 985 | + |
| 986 | + def test4c_delete_structural_correction(self): |
| 987 | + """Deleting a structural correction and restoring the original (split error)""" |
| 988 | + q = fql.Query(Qdelete_structural_correction2) |
| 989 | + results = q(self.doc) |
| 990 | + self.assertIsInstance(results[0], folia.Sentence) |
| 991 | + self.assertIsInstance(results[0][1], folia.Word) |
| 992 | + self.assertIsInstance(results[0][2], folia.Word) |
| 993 | + self.assertEqual(results[0][1].text(), "on") |
| 994 | + self.assertEqual(results[0][2].text(), "weer") |
| 995 | + |
976 | 996 | if os.path.exists('../../FoLiA'):
|
977 | 997 | FOLIAPATH = '../../FoLiA/'
|
978 | 998 | elif os.path.exists('../FoLiA'):
|
|
0 commit comments