syntax-prosody-ot / main

A webapp for the syntax-prosody analyst working in Optimality Theory, with automated Gen, Con and Eval. Download build files from syntax-prosody-ot/build
https://spot.sites.ucsc.edu/
GNU General Public License v2.0
12 stars 2 forks source link

Headedness constraint #467

Closed nkalivoda closed 3 years ago

nkalivoda commented 3 years ago

We should have a constraint Headedness under "Layering and structure" in the non-hidden part. Both cat-sensitive and cat-insensitive as options.

jbellik commented 3 years ago

Constraint definition:

Write the following function:

function headedness(stree, ptree, cat): Return the number of nodes in ptree that a) have children and b) do not have a child of the next lower category or the same category.

If cat is defined, then only count nodes of category cat. If cat is not defined, count nodes of any category that lack a head.

Definition of head: a node of category k has a head if a) it is a terminal (we will assume it is headed, by default), or b) it contains a node in its array of children that is of category k or k-1. If all its children are of category k-2 or lower in the prosodic hierarchy (see prosodicHierarchy.js), then it is unheaded.

For example, a node of category cat: 'i' would be unheaded if its children are all of cat: 'w'. But it would be headed if it contains at least one node of cat: 'phi' (= category k-1) or cat: 'i' (= category k).

jbellik commented 3 years ago

This is a good starter issue.

Steps:

jbellik commented 3 years ago

Prosodic hierarchy is defined main/prosodicHierarchy.js which contains an array pCat that tells you what order the categories occur in.

You can use pCat.nextLower(cat) to identify the next lower category which would be valid as a head. pCat.isLower(cat1, cat2)

pCat.nextHigher()

maxTarlov commented 3 years ago

My availability to help:

jbellik commented 3 years ago

Su, I'm hoping @M130 is you!

maxTarlov commented 3 years ago

Backend debugged and working. @tijgee and @M130 take a look at the test file to make sure you understand what is going on and feel free to ask any questions

jbellik commented 3 years ago

Hi all, please open a pull request if this is ready for review!

jbellik commented 3 years ago

Tree bracketing interpretation example for reference: https://docs.google.com/drawings/d/1poP1VOFSG7Xwsl20QVlfqQBBJyXFE-Y8kfF9h5qBNd8/edit

jbellik commented 3 years ago

Goal for 10/20:

Feel free to set up an additional meeting with me, Max, or Ed if you'd like to talk through how interface1.html is organized.