presciencelabs / tabitha-editor

0 stars 0 forks source link

Add case frame rules #89

Closed craigp-atw closed 4 months ago

craigp-atw commented 4 months ago

Add case frame and sense-selection rules, and other supporting rules such as part-of-speech. Added rules for allow/be/give/have/hear/know/say/see/speak/tell. These check the arguments present for each sense, store the missing and extra arguments, and shows appropriate messages to the user to help them find the right sense or argument structure. Support for more verbs will follow but this is a good start.

Automatic sense selection based on case frame

Automatic sense selected based on case frame and semantic keywords image

Guide user to specify a sense if no sense matches image

Notification of missing arguments image image

Notification of unexpected/extra arguments image

Warn about wrong clause type image image

Support for passive clauses image

Warn about extraneous or misinterpreted 'that's image image

Handle agent clauses (and show error for misused 'it') image

Fixed a couple of issues that Richard/Jeremiah found

Note: For some reason the test suites don't like the use of Object.entries(). I couldn't figure it out, so those tests don't work for me. But running the app works perfectly fine so not sure what the problem is. image

cloudflare-pages[bot] commented 4 months ago

Deploying editor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 703fca5
Status: ✅  Deploy successful!
Preview URL: https://25cf75d5.tabitha-editor.pages.dev
Branch Preview URL: https://add-case-frame-rules.tabitha-editor.pages.dev

View logs

longrunningprocess commented 4 months ago

Note: For some reason the test suites don't like the use of Object.entries(). I couldn't figure it out, so those tests don't work for me. But running the app works perfectly fine so not sure what the problem is.

I'll pull it locally and see if I can offer anything.

It's not the Object.entries that has a problem, the parse_case_frame_rule function is actually undefined in your tests... which would explain why it works at runtime. This is perhaps the result of your for_test() calls not constructing your rules and parser the same way as when it's done at runtime, does that trigger anything for you as a possibility?

craigp-atw commented 4 months ago

It's not the Object.entries that has a problem, the parse_case_frame_rule function is actually undefined in your tests... which would explain why it works at runtime. This is perhaps the result of your for_test() calls not constructing your rules and parser the same way as when it's done at runtime, does that trigger anything for you as a possibility?

I think it has something to do with how the case_frame stuff was imported, due to it being in a nested folder with an index.js?

edit: it was a cyclical import issue, moved some parts of common.js to a new rules.js file