| | 1493 | Rule [] hebrewQuest = new Rule[] { |
|---|
| | 1494 | Rule.makeFromString(0, "CLM", "{CONJ}"), |
|---|
| | 1495 | Rule.makeFromString(1, "OPT", "{V/TNS}"), |
|---|
| | 1496 | Rule.makeFromString(2, "IGN", "{V/STM}"), |
|---|
| | 1497 | Rule.makeFromString(3, "NUC/V", "{V/LEX}"), |
|---|
| | 1498 | Rule.makeFromString(4, "ARG/V", "{V/PGN}"), |
|---|
| | 1499 | Rule.makeFromString(5, "CORE/V", "{OPT} {IGN} {NUC/V} {ARG/V}"), |
|---|
| | 1500 | Rule.makeFromString(5, "N/PROP", "{HEAD/NPROP} {MARK/N}"), |
|---|
| | 1501 | Rule.makeFromString(5, "N/COM", "{HEAD/NCOM} {MARK/N}"), |
|---|
| | 1502 | Rule.makeFromString(6, "NP", "{P} {DET} {N/COM}"), |
|---|
| | 1503 | Rule.makeFromString(6, "NP", "{N/PROP}+"), |
|---|
| | 1504 | Rule.makeFromString(7, "NP", "{N/COM}"), |
|---|
| | 1505 | Rule.makeFromString(6, "NP", "{NP} {CONJ} {NP}"), |
|---|
| | 1506 | Rule.makeFromString(8, "PRED/P", "{P}"), |
|---|
| | 1507 | Rule.makeFromString(9, "NUC/P", "{PRED/P}"), |
|---|
| | 1508 | Rule.makeFromString(10, "NUC", "{CORE/V}"), |
|---|
| | 1509 | Rule.makeFromString(11, "ARG", "{NP}"), |
|---|
| | 1510 | Rule.makeFromString(12, "CORE/P", "{NUC/P} {NP}"), |
|---|
| | 1511 | Rule.makeFromString(12, "PP", "{CORE/P}"), |
|---|
| | 1512 | Rule.makeFromString(12, "PreCS", "{PP}"), |
|---|
| | 1513 | Rule.makeFromString(14, "CORE", "{NUC} {ARG} {ARG}"), |
|---|
| | 1514 | Rule.makeFromString(15, "PERIPH", "{PP}*"), |
|---|
| | 1515 | Rule.makeFromString(16, "CLAUSE", "{CLM}? {PreCS}? {CORE} {PERIPH}?"), |
|---|
| | 1516 | Rule.makeFromString(17, "SENTENCE","{CLAUSE}"), |
|---|
| | 1517 | }; |
|---|
| | 1518 | |
|---|
| 1513 | | Rule [] hebrewQuest = new Rule[] { |
|---|
| 1514 | | Rule.makeFromString(0, "CLM", "{CONJ}"), |
|---|
| 1515 | | Rule.makeFromString(1, "OPT", "{V/TNS}"), |
|---|
| 1516 | | Rule.makeFromString(2, "IGN", "{V/STM}"), |
|---|
| 1517 | | Rule.makeFromString(3, "NUC/V", "{V/LEX}"), |
|---|
| 1518 | | Rule.makeFromString(4, "ARG/V", "{V/PGN}"), |
|---|
| 1519 | | Rule.makeFromString(5, "CORE/V", "{OPT} {IGN} {NUC/V} {ARG/V}"), |
|---|
| 1520 | | Rule.makeFromString(5, "N/PROP", "{HEAD/NPROP} {MARK/N}"), |
|---|
| 1521 | | Rule.makeFromString(5, "N/COM", "{HEAD/NCOM} {MARK/N}"), |
|---|
| 1522 | | Rule.makeFromString(6, "NP", "{N/PROP}+"), |
|---|
| 1523 | | Rule.makeFromString(7, "NP", "{N/COM}"), |
|---|
| 1524 | | Rule.makeFromString(8, "PRED/P", "{P}"), |
|---|
| 1525 | | Rule.makeFromString(9, "NUC/P", "{PRED/P}"), |
|---|
| 1526 | | Rule.makeFromString(10, "NUC", "{CORE/V}"), |
|---|
| 1527 | | Rule.makeFromString(11, "ARG", "{NP}"), |
|---|
| 1528 | | Rule.makeFromString(12, "PP", "{NUC/P} {NP}"), |
|---|
| 1529 | | Rule.makeFromString(14, "CORE", "{NUC} {ARG} {ARG}"), |
|---|
| 1530 | | Rule.makeFromString(15, "PERIPH", "{PP}*"), |
|---|
| 1531 | | Rule.makeFromString(16, "CLAUSE", "{CLM} {CORE} {PERIPH}"), |
|---|
| 1532 | | Rule.makeFromString(17, "SENTENCE","{CLAUSE}"), |
|---|
| 1533 | | }; |
|---|
| 1534 | | |
|---|
| | 1597 | // Gen 02,08 |
|---|
| | 1598 | // |
|---|
| | 1599 | // Input: |
|---|
| | 1600 | // |
|---|
| | 1601 | // B.:- | R;>CI73J- | T | Ã- | Ã- | B.@R@74>- | Ã |
|---|
| | 1602 | // P | HEAD/NCOM | MARK/N | V/TNS | V/STM | V/LEX | V/PGN |
|---|
| | 1603 | // |
|---|
| | 1604 | // >:ELOH- | I92Jm | >;71T | HA- | C.@M- | A73JIm | W:- |
|---|
| | 1605 | // HEAD/NPROP | MARK/N | P | DET | HEAD/NCOM | MARK/N | CONJ |
|---|
| | 1606 | // |
|---|
| | 1607 | // >;71T | H@- | >@75REy- | Ã |
|---|
| | 1608 | // P | DET | HEAD/NCOM | MARK/N |
|---|
| | 1609 | // |
|---|
| | 1610 | // Expected output: |
|---|
| | 1611 | // |
|---|
| | 1612 | // | SENTENCE | |
|---|
| | 1613 | // | CLAUSE | |
|---|
| | 1614 | // | PreCS | CORE | |
|---|
| | 1615 | // | PP | NUC | ARG | ARG | |
|---|
| | 1616 | // | CORE/P | CORE/V | NP | NP | |
|---|
| | 1617 | // | NUC/P | NP | OPT | IGN | NUC/V | ARG/V | | NP | | NP | |
|---|
| | 1618 | // | P | HEAD/NCOM | MARK/N | V/TNS | V/STM | V/LEX | V/PGN | HEAD/NPROP | N/GNS | P | N/COM | N/GNS | CONJ | P | N/COM | N/GNS | |
|---|
| | 1619 | |
|---|
| | 1620 | public void testParseHebrewMorphGenesis1_1() |
|---|
| | 1621 | { |
|---|
| | 1622 | Parser p = new Parser(hebrewQuest); |
|---|
| | 1623 | |
|---|
| | 1624 | List input = new ArrayList(); |
|---|
| | 1625 | |
|---|
| | 1626 | input.add(new MorphEdge("P", "B.:-", 0)); |
|---|
| | 1627 | input.add(new MorphEdge("HEAD/NCOM", "R;>CI73J", 1)); |
|---|
| | 1628 | input.add(new MorphEdge("MARK/N", "T", 2)); |
|---|
| | 1629 | input.add(new MorphEdge("V/TNS", "", 3)); |
|---|
| | 1630 | input.add(new MorphEdge("V/STM", "", 4)); |
|---|
| | 1631 | input.add(new MorphEdge("V/LEX", "B.@R@74>", 5)); |
|---|
| | 1632 | input.add(new MorphEdge("V/PGN", "", 6)); |
|---|
| | 1633 | input.add(new MorphEdge("HEAD/NPROP", ">:ELOH", 7)); |
|---|
| | 1634 | input.add(new MorphEdge("MARK/N", "I92Jm", 8)); |
|---|
| | 1635 | input.add(new MorphEdge("P", ">;71T", 9)); |
|---|
| | 1636 | input.add(new MorphEdge("DET", "HA-", 10)); |
|---|
| | 1637 | input.add(new MorphEdge("HEAD/NCOM", "C.@M", 11)); |
|---|
| | 1638 | input.add(new MorphEdge("MARK/N", "A73JIm", 12)); |
|---|
| | 1639 | input.add(new MorphEdge("CONJ", "W:-", 13)); |
|---|
| | 1640 | input.add(new MorphEdge("P", ">;71T", 14)); |
|---|
| | 1641 | input.add(new MorphEdge("DET", "H@-", 15)); |
|---|
| | 1642 | input.add(new MorphEdge("HEAD/NCOM", ">@75REy", 16)); |
|---|
| | 1643 | input.add(new MorphEdge("MARK/N", "", 17)); |
|---|
| | 1644 | |
|---|
| | 1645 | p.setVerbose(true); |
|---|
| | 1646 | List edges = p.parseFor(input, "SENTENCE"); |
|---|
| | 1647 | assertEquals(1, edges.size()); |
|---|
| | 1648 | |
|---|
| | 1649 | Edge CLAUSE = (Edge)( edges.get(0) ); |
|---|
| | 1650 | |
|---|
| | 1651 | assertEquals("{SENTENCE " + |
|---|
| | 1652 | "{CLAUSE {PreCS {PP {CORE/P " + |
|---|
| | 1653 | "{NUC/P {PRED/P {P \"B.:-\"}}} " + |
|---|
| | 1654 | "{NP {N/COM {HEAD/NCOM \"R;>CI73J\"} {MARK/N \"T\"}}}}}} " + |
|---|
| | 1655 | "{CORE " + |
|---|
| | 1656 | "{NUC {CORE/V " + |
|---|
| | 1657 | "{OPT {V/TNS \"\"}} " + |
|---|
| | 1658 | "{IGN {V/STM \"\"}} " + |
|---|
| | 1659 | "{NUC/V {V/LEX \"B.@R@74>\"}} " + |
|---|
| | 1660 | "{ARG/V {V/PGN \"\"}}" + |
|---|
| | 1661 | "}} " + |
|---|
| | 1662 | "{ARG {NP " + |
|---|
| | 1663 | "{N/PROP {HEAD/NPROP \">:ELOH\"} {MARK/N \"I92Jm\"}}" + |
|---|
| | 1664 | "}} " + |
|---|
| | 1665 | "{ARG {NP " + |
|---|
| | 1666 | "{NP {P \">;71T\"} {DET \"HA-\"} {N/COM {HEAD/NCOM \"C.@M\"} {MARK/N \"A73JIm\"}}} "+ |
|---|
| | 1667 | "{CONJ \"W:-\"} " + |
|---|
| | 1668 | "{NP {P \">;71T\"} {DET \"H@-\"} {N/COM {HEAD/NCOM \">@75REy\"} {MARK/N \"\"}}}"+ |
|---|
| | 1669 | "}}}}}", |
|---|
| | 1670 | CLAUSE.toString()); |
|---|
| | 1671 | } |
|---|
| | 1672 | |
|---|