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

Match to any prosodic category #579

Closed jbellik closed 3 years ago

jbellik commented 3 years ago
  1. Test MatchSP(inputTree, ptree, 'xp', {anyPCat: true})
  2. Add interface support for MatchSP-anyPCat: There should be an option under Custom MatchSP called "Ignore prosodic categories." Info: "If this option is checked, any prosodic constituent that has the same terminal string as a syntactic constituent s will be considered a valid Match for s." This would set options.anyPCat:true.

See #332

jbellik commented 3 years ago

Test cases: stree1 ={ "id": "CP1", "cat": "cp", "children": [ { "id": "a", "cat": "x0"}, {"cat": "cp", "id": "XP_4", "children": [ {"id": "b", "cat": "x0"}, { "id": "c", "cat": "x0"} ] } ] }

CPs can be matched to phis ptree1 = (a (b c)) (where parentheses stand for the edges of nodes with cat: 'phi') ptree2 = ((a b) c) matchSP(stree1, ptree1, 'cp', {anyPCat:true}) = 0 matchSP(stree1, ptree2, 'cp', {anyPCat:true}) = 1

stree2 = { "id": "CP1", "cat": "cp", "children": [ {"cat": "xp", "id": "XP_8", "children": [ {"id": "a", "cat": "x0"} ] }, { "cat": "xp", "id": "XP_9", "children": [ {"id": "b", "cat": "x0"} ] }, { "cat": "xp", "id": "XP_10", "children": [ {"id": "c", "cat": "x0"} ] } ] }

XPs can be matched by words: matchSP(stree2, ptree1, 'xp', {anyPCat:true}) = 0

Violations still happen when ids don't match: ptree3 = (x y z) matchSP(stree2, ptree3, 'xp', {anyPCat:true}) = 4

jbellik commented 3 years ago

(Sorry the indentation completely disappears!)

jbellik commented 3 years ago

Adding this to the interface: Make it a separate constraint on the interface, like MatchNonminimal, and put it above MatchNonminimal.

Match(Syntax -> Prosody), any prosodic constituent [ ] cp [ ] xp [ ] x0 [ ] all syntactic categories

On the backend, this should call: matchSP(stree, ptree, cat, {anyPCat: true})