Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated testing for other alignment constraints #486

Open
jbellik opened this issue Oct 21, 2020 · 2 comments
Open

Automated testing for other alignment constraints #486

jbellik opened this issue Oct 21, 2020 · 2 comments

Comments

@jbellik
Copy link
Contributor

jbellik commented Oct 21, 2020

Create an html file with Mocha tests for:

Align left/right Focus
Align left/right lexical item

@jbellik
Copy link
Contributor Author

jbellik commented Apr 5, 2021

Let stree = [a.foc [b.foc [c.foc]]], where all terminal nodes have foc:true
Then:
alignFocLeft(stree, {(a.foc (b.foc (c.foc)))}, phi) = 0
alignFocRight(stree, {(a.foc (b.foc (c.foc)))}, phi) = 2

alignFocLeft(stree, {(((a.foc) b.foc) c.foc)}, phi) = 2
alignFocRight(stree, {(((a.foc) b.foc) c.foc)}, phi) = 0

alignFocLeft(stree, {(a.foc b.foc c.foc)}, phi) = 2
alignFocRight(stree, {(a.foc b.foc c.foc)}, phi) = 2

alignFocLeft(stree, {a.foc b.foc c.foc}, phi) = 3
alignFocRight(stree, {a.foc b.foc c.foc}, phi) = 3

alignFocLeft(stree, {a.foc {b.foc {c.foc}}}, i) = 0
alignFocRight(stree, {{{a.foc} b.foc} c.foc}, i) = 0
alignFocLeft(stree, {a.foc {b.foc {c.foc}}}, phi) = 3
alignFocRight(stree, {{{a.foc} b.foc} c.foc}, phi) = 3
alignFocLeft(stree, {a.foc {b.foc {c.foc}}}, w) = 0
alignFocRight(stree, {{{a.foc} b.foc} c.foc}, w) = 0

The maximum number of violations is the number of focused terminals in the output.
alignFocLeft(stree, {a {b.foc {c}}}, i) = 0
alignFocRight(stree, {{{a} b.foc} c}, i) = 0
alignFocLeft(stree, {a {b.foc {c}}}, phi) = 1
alignFocRight(stree, {{{a} b.foc} c}, phi) = 1
alignFocLeft(stree, {a {b.foc {c.foc}}}, phi) = 2
alignFocRight(stree, {{{a} b.foc} c.foc}, phi) = 2

@jbellik
Copy link
Contributor Author

jbellik commented Apr 5, 2021

Expected results for alignLeftMorpheme(stree, ptree, 'x') (where x is supposed to be aligned all the way left):
ptree = {a b c x} --> 4
{a b x c} --> 3
{a x b c} --> 1
{a b c} --> 0

Also test that alignLeftMorpheme can handle a space separated string of morphemes to check for. Expected results for alignLeftMorpheme(stree, ptree, 'x y'):
ptree = {a b c x y} --> 3 violations for x and 4 violations for y = 7 violations
{x y a b c} --> 0 violations for x and 1 violation for y = 1 violation total
{x a b c y} --> 4 total (for y)

Mirror image results should obtain for alignRightMorpheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant