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

"Trim Syntactic tree" info question #517

Closed nkalivoda closed 3 years ago

nkalivoda commented 3 years ago

What are the "silent nodes" mentioned in the "Trim Syntactic tree" info? I know a category can be suffixed with ",silentHead", but what makes a node silent? It would be good to spell everything out in more detail.

jbellik commented 3 years ago

This is a good question. The short answer is that the function trimSilentTerminals() in treeTrimming.js removes nodes with the attribute "silent" set to true. The long answer is that as the code currently stands, I don't think those silent nodes are actually getting trimmed. Here's why:

  1. Checking "Trim syntactic tree" results setting the makeTableau() option trimSTrees to true
  2. Setting trimSTrees to true causes makeTableau() to run trimRedundantNodes() on the syntactic tree, with no other arguments.
  3. trimRedundantNodes() is defined in treeTrimming.js. It appears to only run trimSilentTerminals (which removes terminals with attribute silent:true) when its argument "attribute" === "silent", and likewise it only seems to run trimFunctionalTerminals (which removes terminals with attribute func:true) when the argument "attribute" === "func".
  4. makeTableau()'s call to trimRedundantNodes() does not pass in any attribute, so I believe it's actually only trimming out nodes that are co-terminous with some other node.

However, when I tried to test this just now, I got a console error: "Cannot read children of undefined" -- so we actually have bigger problems here than just inadequate info text!

jbellik commented 3 years ago

@maxTarlov can we discuss this next week when we meet?

3ddiehead commented 3 years ago

In the branch "trimming_bug", I changed the call on trimRedundantNodes() to removeSpecifiedNodes() with the argument for attribute = "silent" I also made trimRedundantNodes() trim redundant nodes even if no particular attribute is passed through.

I suggest adding options to the "Trim syntactic tree" checkbox for silent terminals, functional terminals, and neither (just trims redundant nodes). I also suggest changing the info box for "Trim syntactic tree" to remove "terminals of a category other than "x0" or "clitic" are removed." Do I have the go-ahead?

Also regarding trimming non-terminals that have the attribute "silent" or "func," the current interface does not remove them, but I don't think this needs to be an option (bringing it back around to what Nick asked initially). Trimming terminals will cause nodes without leaves to be removed automatically. There is one case that I'm thinking about where the node is not removed and that is something with an embedded CP w/ a silent head.

{[ a { b.silent [ c ]}]} --> {[ a {[ c ]}]} instead of {[ a [ c ]]}

Should I come up with a solution to this as well?

jbellik commented 3 years ago

Let's discuss at the meeting today.

On Tue, Feb 2, 2021 at 3:54 PM 3ddiehead notifications@github.com wrote:

In the branch "trimming_bug", I changed the call on trimRedundantNodes() to removeSpecifiedNodes() with the argument for attribute = "silent" I also made trimRedundantNodes() trim redundant nodes even if no particular attribute is passed through.

I suggest adding options to the "Trim syntactic tree" for silent terminals, functional terminals, and neither (just trims redundant nodes). I also suggest changing the info box for "Trim syntactic tree" to remove "terminals of a category other than "x0" or "clitic" are removed." Do I have the go-ahead?

Also regarding trimming non-terminals that have the attribute "silent" or "func," the current interface does not remove them, but I don't think this needs to be an option (bringing it back around to what Nick asked initially). Trimming terminals will cause nodes without leaves to be removed automatically. There is one case that I'm thinking about where the node is not removed and that is something with an embedded CP w/ a silent head.

{[ a { b.silent [ c ]}]} --> {[ a {[ c ]}]} instead of {[ a [ c ]]}

Should I come up with a solution to this as well?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/syntax-prosody-ot/main/issues/517#issuecomment-772096843, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7ROKXCFDCHRVWDF5A4JGDS5CGDTANCNFSM4UOSIU2A .

--

-- Jennifer Bellik, PhD Post-doctoral researcher & lecturer UC Santa Cruz https://people.ucsc.edu/~jbellik/

jbellik commented 3 years ago