Module: ScientificName
- Includes:
- Treetop::Runtime
- Included in:
- ScientificNameParser
- Defined in:
- lib/biodiversity/parser/scientific_name.rb
Defined Under Namespace
Modules: AuthorName0, AuthorName1, AuthorNameSeparator0, AuthorWord0, AuthorWord1, AuthorWord2, AuthorsNames0, AuthorsNames1, AuthorsNamesFull0, AuthorsNamesFull1, AuthorsPart0, AuthorsPart1, AuthorsPart2, AuthorsPart3, AuthorsPart4, AuthorsPart5, AuthorsRevisedName0, AuthorsRevisedName1, CapLatinWord0, CapLatinWord1, CompositeScientificName0, CompositeScientificName1, CompositeScientificName2, CompositeScientificName3, Editorials0, Editorials1, EditorialsFull0, EditorialsFull1, HybridSeparator0, LatinWord0, LatinWord1, NamePart0, NamePart1, NamePart2, NamePart3, NamePart4, NamePart5, OriginalAuthorsNamesFull0, OriginalAuthorsNamesFull1, OriginalAuthorsRevisedName0, OriginalAuthorsRevisedName1, ScientificName0, ScientificName1, ScientificName2, ScientificName3, ScientificName4, ScientificName5, Selector0, SimpleAuthorsPart0, SimpleAuthorsPart1, SpeciesName0, SpeciesName1, SpeciesName2, SpeciesName3, SpeciesName4, SpeciesName5, SpeciesName6, SpeciesName7, SpeciesName8, SpeciesName9, StatusPart0, StatusPart1, StatusWord0, StatusWord1, Subgenus0, Subgenus1, SubspeciesName0, SubspeciesName1, SubspeciesNames0, SubspeciesNames1, Year0
Instance Method Summary collapse
- #_nt_author_name ⇒ Object
- #_nt_author_name_separator ⇒ Object
- #_nt_author_word ⇒ Object
- #_nt_authors_names ⇒ Object
- #_nt_authors_names_full ⇒ Object
- #_nt_authors_part ⇒ Object
- #_nt_authors_revised_name ⇒ Object
- #_nt_cap_latin_word ⇒ Object
- #_nt_composite_scientific_name ⇒ Object
- #_nt_editorials ⇒ Object
- #_nt_editorials_full ⇒ Object
- #_nt_hybrid_separator ⇒ Object
- #_nt_latin_word ⇒ Object
- #_nt_name_part ⇒ Object
- #_nt_original_authors_names_full ⇒ Object
- #_nt_original_authors_revised_name ⇒ Object
- #_nt_scientific_name ⇒ Object
- #_nt_selector ⇒ Object
- #_nt_simple_authors_part ⇒ Object
- #_nt_space ⇒ Object
- #_nt_space_hard ⇒ Object
- #_nt_species_name ⇒ Object
- #_nt_status_part ⇒ Object
- #_nt_status_word ⇒ Object
- #_nt_subgenus ⇒ Object
- #_nt_subspecies_name ⇒ Object
- #_nt_subspecies_names ⇒ Object
- #_nt_year ⇒ Object
- #root ⇒ Object
Instance Method Details
#_nt_author_name ⇒ Object
1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1292 def start_index = index if node_cache[:author_name].has_key?(index) cached = node_cache[:author_name][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_space s1 << r2 if r2 r3 = s1 << r3 if r3 r4 = _nt_space s1 << r4 if r4 r5 = s1 << r5 if r5 r6 = _nt_space s1 << r6 end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(AuthorName0) r1.extend(AuthorName1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r7 = if r7 r0 = r7 else self.index = i0 r0 = nil end end node_cache[:author_name][start_index] = r0 return r0 end |
#_nt_author_name_separator ⇒ Object
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1219 def start_index = index if node_cache[:author_name_separator].has_key?(index) cached = node_cache[:author_name_separator][index] @index = cached.interval.end if cached return cached end i0 = index if input.index("&", index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("&") r1 = nil end if r1 r0 = r1 r0.extend(AuthorNameSeparator0) else if input.index(",", index) == index r2 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure(",") r2 = nil end if r2 r0 = r2 r0.extend(AuthorNameSeparator0) else self.index = i0 r0 = nil end end node_cache[:author_name_separator][start_index] = r0 return r0 end |
#_nt_author_word ⇒ Object
1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1366 def start_index = index if node_cache[:author_word].has_key?(index) cached = node_cache[:author_word][index] @index = cached.interval.end if cached return cached end i0 = index if input.index("A S. Xu", index) == index r1 = (SyntaxNode).new(input, index...(index + 7)) @index += 7 else terminal_parse_failure("A S. Xu") r1 = nil end if r1 r0 = r1 else i2 = index if input.index("anon.", index) == index r3 = (SyntaxNode).new(input, index...(index + 5)) @index += 5 else terminal_parse_failure("anon.") r3 = nil end if r3 r2 = r3 r2.extend(AuthorWord0) else if input.index("f.", index) == index r4 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("f.") r4 = nil end if r4 r2 = r4 r2.extend(AuthorWord0) else if input.index("bis", index) == index r5 = (SyntaxNode).new(input, index...(index + 3)) @index += 3 else terminal_parse_failure("bis") r5 = nil end if r5 r2 = r5 r2.extend(AuthorWord0) else if input.index("arg.", index) == index r6 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("arg.") r6 = nil end if r6 r2 = r6 r2.extend(AuthorWord0) else if input.index("da", index) == index r7 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("da") r7 = nil end if r7 r2 = r7 r2.extend(AuthorWord0) else if input.index("der", index) == index r8 = (SyntaxNode).new(input, index...(index + 3)) @index += 3 else terminal_parse_failure("der") r8 = nil end if r8 r2 = r8 r2.extend(AuthorWord0) else if input.index("den", index) == index r9 = (SyntaxNode).new(input, index...(index + 3)) @index += 3 else terminal_parse_failure("den") r9 = nil end if r9 r2 = r9 r2.extend(AuthorWord0) else if input.index("de", index) == index r10 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("de") r10 = nil end if r10 r2 = r10 r2.extend(AuthorWord0) else if input.index("du", index) == index r11 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("du") r11 = nil end if r11 r2 = r11 r2.extend(AuthorWord0) else if input.index("la", index) == index r12 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("la") r12 = nil end if r12 r2 = r12 r2.extend(AuthorWord0) else if input.index("ter", index) == index r13 = (SyntaxNode).new(input, index...(index + 3)) @index += 3 else terminal_parse_failure("ter") r13 = nil end if r13 r2 = r13 r2.extend(AuthorWord0) else if input.index("van", index) == index r14 = (SyntaxNode).new(input, index...(index + 3)) @index += 3 else terminal_parse_failure("van") r14 = nil end if r14 r2 = r14 r2.extend(AuthorWord0) else if input.index("et al.\{\?\}", index) == index r15 = (SyntaxNode).new(input, index...(index + 9)) @index += 9 else terminal_parse_failure("et al.\{\?\}") r15 = nil end if r15 r2 = r15 r2.extend(AuthorWord0) else if input.index("et al.", index) == index r16 = (SyntaxNode).new(input, index...(index + 6)) @index += 6 else terminal_parse_failure("et al.") r16 = nil end if r16 r2 = r16 r2.extend(AuthorWord0) else self.index = i2 r2 = nil end end end end end end end end end end end end end end if r2 r0 = r2 else i17, s17 = index, [] i18 = index if input.index("Å", index) == index r19 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Å") r19 = nil end if r19 r18 = r19 else if input.index("Ö", index) == index r20 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ö") r20 = nil end if r20 r18 = r20 else if input.index("Á", index) == index r21 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Á") r21 = nil end if r21 r18 = r21 else if input.index("Ø", index) == index r22 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ø") r22 = nil end if r22 r18 = r22 else if input.index("Ô", index) == index r23 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ô") r23 = nil end if r23 r18 = r23 else if input.index("Š", index) == index r24 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Š") r24 = nil end if r24 r18 = r24 else if input.index("Ś", index) == index r25 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ś") r25 = nil end if r25 r18 = r25 else if input.index("Č", index) == index r26 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Č") r26 = nil end if r26 r18 = r26 else if input.index("Ķ", index) == index r27 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ķ") r27 = nil end if r27 r18 = r27 else if input.index("Ł", index) == index r28 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ł") r28 = nil end if r28 r18 = r28 else if input.index("É", index) == index r29 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("É") r29 = nil end if r29 r18 = r29 else if input.index("Ž", index) == index r30 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("Ž") r30 = nil end if r30 r18 = r30 else if input.index(Regexp.new('[A-Z]'), index) == index r31 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r31 = nil end if r31 r18 = r31 else self.index = i18 r18 = nil end end end end end end end end end end end end end s17 << r18 if r18 s32, i32 = [], index loop do if input.index(Regexp.new('[^0-9()\\s&,]'), index) == index r33 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r33 = nil end if r33 s32 << r33 else break end end if s32.empty? self.index = i32 r32 = nil else r32 = SyntaxNode.new(input, i32...index, s32) end s17 << r32 end if s17.last r17 = (SyntaxNode).new(input, i17...index, s17) r17.extend(AuthorWord1) r17.extend(AuthorWord2) else self.index = i17 r17 = nil end if r17 r0 = r17 else self.index = i0 r0 = nil end end end node_cache[:author_word][start_index] = r0 return r0 end |
#_nt_authors_names ⇒ Object
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1156 def start_index = index if node_cache[:authors_names].has_key?(index) cached = node_cache[:authors_names][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 r4 = s1 << r4 if r4 r5 = _nt_space s1 << r5 if r5 r6 = s1 << r6 end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(AuthorsNames0) r1.extend(AuthorsNames1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r7 = if r7 r0 = r7 else self.index = i0 r0 = nil end end node_cache[:authors_names][start_index] = r0 return r0 end |
#_nt_authors_names_full ⇒ Object
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1061 def start_index = index if node_cache[:authors_names_full].has_key?(index) cached = node_cache[:authors_names_full][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 if input.index(Regexp.new('[,]'), index) == index r5 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r5 = nil end if r5 r4 = r5 else r4 = SyntaxNode.new(input, index...index) end s1 << r4 if r4 r6 = _nt_space s1 << r6 if r6 r7 = _nt_year s1 << r7 end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(AuthorsNamesFull0) r1.extend(AuthorsNamesFull1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r8 = if r8 r0 = r8 else self.index = i0 r0 = nil end end node_cache[:authors_names_full][start_index] = r0 return r0 end |
#_nt_authors_part ⇒ Object
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 617 def start_index = index if node_cache[:authors_part].has_key?(index) cached = node_cache[:authors_part][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 r4 = s1 << r4 end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(AuthorsPart0) r1.extend(AuthorsPart1) else self.index = i1 r1 = nil end if r1 r0 = r1 else i5, s5 = index, [] r6 = s5 << r6 if r6 r7 = _nt_space s5 << r7 if r7 if input.index("ex", index) == index r8 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("ex") r8 = nil end s5 << r8 if r8 r9 = _nt_space s5 << r9 if r9 r10 = s5 << r10 end end end end if s5.last r5 = (SyntaxNode).new(input, i5...index, s5) r5.extend(AuthorsPart2) r5.extend(AuthorsPart3) else self.index = i5 r5 = nil end if r5 r0 = r5 else i11, s11 = index, [] r12 = s11 << r12 if r12 r13 = _nt_space s11 << r13 if r13 r14 = s11 << r14 end end if s11.last r11 = (SyntaxNode).new(input, i11...index, s11) r11.extend(AuthorsPart4) r11.extend(AuthorsPart5) else self.index = i11 r11 = nil end if r11 r0 = r11 else r15 = if r15 r0 = r15 else r16 = if r16 r0 = r16 else r17 = if r17 r0 = r17 else self.index = i0 r0 = nil end end end end end end node_cache[:authors_part][start_index] = r0 return r0 end |
#_nt_authors_revised_name ⇒ Object
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 987 def start_index = index if node_cache[:authors_revised_name].has_key?(index) cached = node_cache[:authors_revised_name][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] r1 = s0 << r1 if r1 r2 = _nt_space s0 << r2 if r2 if input.index("ex", index) == index r3 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("ex") r3 = nil end s0 << r3 if r3 r4 = _nt_space s0 << r4 if r4 r5 = s0 << r5 end end end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(AuthorsRevisedName0) r0.extend(AuthorsRevisedName1) else self.index = i0 r0 = nil end node_cache[:authors_revised_name][start_index] = r0 return r0 end |
#_nt_cap_latin_word ⇒ Object
3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3171 def _nt_cap_latin_word start_index = index if node_cache[:cap_latin_word].has_key?(index) cached = node_cache[:cap_latin_word][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] if input.index(Regexp.new('[A-Z]'), index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r1 = nil end s0 << r1 if r1 if input.index(Regexp.new('[a-zë]'), index) == index r2 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r2 = nil end s0 << r2 if r2 s3, i3 = [], index loop do if input.index(Regexp.new('[a-z\\-ëüäöï]'), index) == index r4 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r4 = nil end if r4 s3 << r4 else break end end if s3.empty? self.index = i3 r3 = nil else r3 = SyntaxNode.new(input, i3...index, s3) end s0 << r3 end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(CapLatinWord0) r0.extend(CapLatinWord1) else self.index = i0 r0 = nil end node_cache[:cap_latin_word][start_index] = r0 return r0 end |
#_nt_composite_scientific_name ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 79 def _nt_composite_scientific_name start_index = index if node_cache[:composite_scientific_name].has_key?(index) cached = node_cache[:composite_scientific_name][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_scientific_name s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 r4 = _nt_hybrid_separator s1 << r4 if r4 r5 = _nt_space s1 << r5 if r5 r6 = _nt_scientific_name s1 << r6 if r6 r7 = _nt_space s1 << r7 end end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(CompositeScientificName0) r1.extend(CompositeScientificName1) else self.index = i1 r1 = nil end if r1 r0 = r1 else i8, s8 = index, [] r9 = _nt_scientific_name s8 << r9 if r9 r10 = _nt_space s8 << r10 if r10 r11 = _nt_hybrid_separator s8 << r11 if r11 r12 = _nt_space s8 << r12 if r12 if input.index(Regexp.new('[\\?]'), index) == index r14 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r14 = nil end if r14 r13 = r14 else r13 = SyntaxNode.new(input, index...index) end s8 << r13 end end end end if s8.last r8 = (SyntaxNode).new(input, i8...index, s8) r8.extend(CompositeScientificName2) r8.extend(CompositeScientificName3) else self.index = i8 r8 = nil end if r8 r0 = r8 else r15 = _nt_scientific_name if r15 r0 = r15 else self.index = i0 r0 = nil end end end node_cache[:composite_scientific_name][start_index] = r0 return r0 end |
#_nt_editorials ⇒ Object
2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 2209 def _nt_editorials start_index = index if node_cache[:editorials].has_key?(index) cached = node_cache[:editorials][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_space s1 << r2 if r2 r3 = _nt_selector s1 << r3 if r3 r4 = _nt_space s1 << r4 if r4 if input.index(Regexp.new('[&]'), index) == index r6 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r6 = nil end if r6 r5 = r6 else r5 = SyntaxNode.new(input, index...index) end s1 << r5 if r5 r7 = _nt_space s1 << r7 if r7 r8 = _nt_editorials s1 << r8 end end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(Editorials0) r1.extend(Editorials1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r9 = _nt_selector if r9 r0 = r9 else self.index = i0 r0 = nil end end node_cache[:editorials][start_index] = r0 return r0 end |
#_nt_editorials_full ⇒ Object
2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 2128 def _nt_editorials_full start_index = index if node_cache[:editorials_full].has_key?(index) cached = node_cache[:editorials_full][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] if input.index("(", index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("(") r1 = nil end s0 << r1 if r1 r2 = _nt_space s0 << r2 if r2 r3 = _nt_editorials s0 << r3 if r3 r4 = _nt_space s0 << r4 if r4 if input.index(")", index) == index r5 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure(")") r5 = nil end s0 << r5 end end end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(EditorialsFull0) r0.extend(EditorialsFull1) else self.index = i0 r0 = nil end node_cache[:editorials_full][start_index] = r0 return r0 end |
#_nt_hybrid_separator ⇒ Object
3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3239 def _nt_hybrid_separator start_index = index if node_cache[:hybrid_separator].has_key?(index) cached = node_cache[:hybrid_separator][index] @index = cached.interval.end if cached return cached end i0 = index if input.index("x", index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("x") r1 = nil end if r1 r0 = r1 r0.extend(HybridSeparator0) else if input.index("X", index) == index r2 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("X") r2 = nil end if r2 r0 = r2 r0.extend(HybridSeparator0) else if input.index("×", index) == index r3 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("×") r3 = nil end if r3 r0 = r3 r0.extend(HybridSeparator0) else self.index = i0 r0 = nil end end end node_cache[:hybrid_separator][start_index] = r0 return r0 end |
#_nt_latin_word ⇒ Object
3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3101 def _nt_latin_word start_index = index if node_cache[:latin_word].has_key?(index) cached = node_cache[:latin_word][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] if input.index(Regexp.new('[a-zë]'), index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do if input.index(Regexp.new('[a-z\\-ëüäöï]'), index) == index r3 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r3 = nil end if r3 s2 << r3 else break end end if s2.empty? self.index = i2 r2 = nil else r2 = SyntaxNode.new(input, i2...index, s2) end s0 << r2 end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(LatinWord0) r0.extend(LatinWord1) else self.index = i0 r0 = nil end node_cache[:latin_word][start_index] = r0 return r0 end |
#_nt_name_part ⇒ Object
1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1852 def _nt_name_part start_index = index if node_cache[:name_part].has_key?(index) cached = node_cache[:name_part][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_space s1 << r2 if r2 r3 = _nt_species_name s1 << r3 if r3 r4 = _nt_space s1 << r4 if r4 r5 = _nt_selector s1 << r5 if r5 r6 = _nt_space_hard s1 << r6 if r6 r7 = _nt_editorials_full s1 << r7 end end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(NamePart0) r1.extend(NamePart1) else self.index = i1 r1 = nil end if r1 r0 = r1 else i8, s8 = index, [] r9 = _nt_space s8 << r9 if r9 r10 = _nt_species_name s8 << r10 if r10 r11 = _nt_space s8 << r11 if r11 r12 = _nt_subspecies_names s8 << r12 end end end if s8.last r8 = (SyntaxNode).new(input, i8...index, s8) r8.extend(NamePart2) r8.extend(NamePart3) else self.index = i8 r8 = nil end if r8 r0 = r8 else i13, s13 = index, [] r14 = _nt_space s13 << r14 if r14 r15 = _nt_species_name s13 << r15 if r15 r16 = _nt_space s13 << r16 if r16 r17 = _nt_latin_word s13 << r17 end end end if s13.last r13 = (SyntaxNode).new(input, i13...index, s13) r13.extend(NamePart4) r13.extend(NamePart5) else self.index = i13 r13 = nil end if r13 r0 = r13 else r18 = _nt_species_name if r18 r0 = r18 else r19 = _nt_cap_latin_word if r19 r0 = r19 else self.index = i0 r0 = nil end end end end end node_cache[:name_part][start_index] = r0 return r0 end |
#_nt_original_authors_names_full ⇒ Object
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 829 def start_index = index if node_cache[:original_authors_names_full].has_key?(index) cached = node_cache[:original_authors_names_full][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] if input.index("(", index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("(") r1 = nil end s0 << r1 if r1 r2 = _nt_space s0 << r2 if r2 r3 = s0 << r3 if r3 r4 = _nt_space s0 << r4 if r4 if input.index(")", index) == index r5 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure(")") r5 = nil end s0 << r5 end end end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(OriginalAuthorsNamesFull0) r0.extend(OriginalAuthorsNamesFull1) else self.index = i0 r0 = nil end node_cache[:original_authors_names_full][start_index] = r0 return r0 end |
#_nt_original_authors_revised_name ⇒ Object
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 907 def start_index = index if node_cache[:original_authors_revised_name].has_key?(index) cached = node_cache[:original_authors_revised_name][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] if input.index("(", index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("(") r1 = nil end s0 << r1 if r1 r2 = _nt_space s0 << r2 if r2 r3 = s0 << r3 if r3 r4 = _nt_space s0 << r4 if r4 if input.index(")", index) == index r5 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure(")") r5 = nil end s0 << r5 end end end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(OriginalAuthorsRevisedName0) r0.extend(OriginalAuthorsRevisedName1) else self.index = i0 r0 = nil end node_cache[:original_authors_revised_name][start_index] = r0 return r0 end |
#_nt_scientific_name ⇒ Object
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 289 def _nt_scientific_name start_index = index if node_cache[:scientific_name].has_key?(index) cached = node_cache[:scientific_name][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_space s1 << r2 if r2 r3 = _nt_name_part s1 << r3 if r3 r4 = _nt_space s1 << r4 if r4 r5 = s1 << r5 if r5 r6 = _nt_space s1 << r6 if r6 r7 = _nt_status_part s1 << r7 if r7 r8 = _nt_space s1 << r8 end end end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(ScientificName0) r1.extend(ScientificName1) else self.index = i1 r1 = nil end if r1 r0 = r1 else i9, s9 = index, [] r10 = _nt_space s9 << r10 if r10 r11 = _nt_name_part s9 << r11 if r11 r12 = _nt_space s9 << r12 if r12 r13 = s9 << r13 if r13 r14 = _nt_space s9 << r14 end end end end if s9.last r9 = (SyntaxNode).new(input, i9...index, s9) r9.extend(ScientificName2) r9.extend(ScientificName3) else self.index = i9 r9 = nil end if r9 r0 = r9 else i15, s15 = index, [] r16 = _nt_space s15 << r16 if r16 r17 = _nt_name_part s15 << r17 if r17 r18 = _nt_space s15 << r18 if r18 r19 = _nt_year s15 << r19 if r19 r20 = _nt_space s15 << r20 end end end end if s15.last r15 = (SyntaxNode).new(input, i15...index, s15) r15.extend(ScientificName4) r15.extend(ScientificName5) else self.index = i15 r15 = nil end if r15 r0 = r15 else r21 = _nt_name_part if r21 r0 = r21 else self.index = i0 r0 = nil end end end end node_cache[:scientific_name][start_index] = r0 return r0 end |
#_nt_selector ⇒ Object
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 2291 def _nt_selector start_index = index if node_cache[:selector].has_key?(index) cached = node_cache[:selector][index] @index = cached.interval.end if cached return cached end i0 = index if input.index("f.sp.", index) == index r1 = (SyntaxNode).new(input, index...(index + 5)) @index += 5 else terminal_parse_failure("f.sp.") r1 = nil end if r1 r0 = r1 r0.extend(Selector0) else if input.index("f.", index) == index r2 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("f.") r2 = nil end if r2 r0 = r2 r0.extend(Selector0) else if input.index("B", index) == index r3 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("B") r3 = nil end if r3 r0 = r3 r0.extend(Selector0) else if input.index("ssp.", index) == index r4 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("ssp.") r4 = nil end if r4 r0 = r4 r0.extend(Selector0) else if input.index("mut.", index) == index r5 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("mut.") r5 = nil end if r5 r0 = r5 r0.extend(Selector0) else if input.index("pseudovar.", index) == index r6 = (SyntaxNode).new(input, index...(index + 10)) @index += 10 else terminal_parse_failure("pseudovar.") r6 = nil end if r6 r0 = r6 r0.extend(Selector0) else if input.index("sect.", index) == index r7 = (SyntaxNode).new(input, index...(index + 5)) @index += 5 else terminal_parse_failure("sect.") r7 = nil end if r7 r0 = r7 r0.extend(Selector0) else if input.index("ser.", index) == index r8 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("ser.") r8 = nil end if r8 r0 = r8 r0.extend(Selector0) else if input.index("var.", index) == index r9 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("var.") r9 = nil end if r9 r0 = r9 r0.extend(Selector0) else if input.index("subvar.", index) == index r10 = (SyntaxNode).new(input, index...(index + 7)) @index += 7 else terminal_parse_failure("subvar.") r10 = nil end if r10 r0 = r10 r0.extend(Selector0) else if input.index("[var.]", index) == index r11 = (SyntaxNode).new(input, index...(index + 6)) @index += 6 else terminal_parse_failure("[var.]") r11 = nil end if r11 r0 = r11 r0.extend(Selector0) else if input.index("subsp.", index) == index r12 = (SyntaxNode).new(input, index...(index + 6)) @index += 6 else terminal_parse_failure("subsp.") r12 = nil end if r12 r0 = r12 r0.extend(Selector0) else if input.index("subf.", index) == index r13 = (SyntaxNode).new(input, index...(index + 5)) @index += 5 else terminal_parse_failure("subf.") r13 = nil end if r13 r0 = r13 r0.extend(Selector0) else if input.index("race", index) == index r14 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("race") r14 = nil end if r14 r0 = r14 r0.extend(Selector0) else if input.index("α", index) == index r15 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("α") r15 = nil end if r15 r0 = r15 r0.extend(Selector0) else if input.index("ββ", index) == index r16 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("ββ") r16 = nil end if r16 r0 = r16 r0.extend(Selector0) else if input.index("β", index) == index r17 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("β") r17 = nil end if r17 r0 = r17 r0.extend(Selector0) else if input.index("γ", index) == index r18 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("γ") r18 = nil end if r18 r0 = r18 r0.extend(Selector0) else if input.index("δ", index) == index r19 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("δ") r19 = nil end if r19 r0 = r19 r0.extend(Selector0) else if input.index("ε", index) == index r20 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("ε") r20 = nil end if r20 r0 = r20 r0.extend(Selector0) else if input.index("φ", index) == index r21 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("φ") r21 = nil end if r21 r0 = r21 r0.extend(Selector0) else if input.index("θ", index) == index r22 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("θ") r22 = nil end if r22 r0 = r22 r0.extend(Selector0) else if input.index("μ", index) == index r23 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("μ") r23 = nil end if r23 r0 = r23 r0.extend(Selector0) else if input.index("a.", index) == index r24 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("a.") r24 = nil end if r24 r0 = r24 r0.extend(Selector0) else if input.index("b.", index) == index r25 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("b.") r25 = nil end if r25 r0 = r25 r0.extend(Selector0) else if input.index("c.", index) == index r26 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("c.") r26 = nil end if r26 r0 = r26 r0.extend(Selector0) else if input.index("d.", index) == index r27 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("d.") r27 = nil end if r27 r0 = r27 r0.extend(Selector0) else if input.index("e.", index) == index r28 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("e.") r28 = nil end if r28 r0 = r28 r0.extend(Selector0) else if input.index("g.", index) == index r29 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("g.") r29 = nil end if r29 r0 = r29 r0.extend(Selector0) else if input.index("k.", index) == index r30 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("k.") r30 = nil end if r30 r0 = r30 r0.extend(Selector0) else if input.index("****", index) == index r31 = (SyntaxNode).new(input, index...(index + 4)) @index += 4 else terminal_parse_failure("****") r31 = nil end if r31 r0 = r31 r0.extend(Selector0) else if input.index("**", index) == index r32 = (SyntaxNode).new(input, index...(index + 2)) @index += 2 else terminal_parse_failure("**") r32 = nil end if r32 r0 = r32 r0.extend(Selector0) else if input.index("*", index) == index r33 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("*") r33 = nil end if r33 r0 = r33 r0.extend(Selector0) else self.index = i0 r0 = nil end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end end node_cache[:selector][start_index] = r0 return r0 end |
#_nt_simple_authors_part ⇒ Object
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 755 def start_index = index if node_cache[:simple_authors_part].has_key?(index) cached = node_cache[:simple_authors_part][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 r4 = s1 << r4 end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(SimpleAuthorsPart0) r1.extend(SimpleAuthorsPart1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r5 = if r5 r0 = r5 else r6 = if r6 r0 = r6 else self.index = i0 r0 = nil end end end node_cache[:simple_authors_part][start_index] = r0 return r0 end |
#_nt_space ⇒ Object
3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3336 def _nt_space start_index = index if node_cache[:space].has_key?(index) cached = node_cache[:space][index] @index = cached.interval.end if cached return cached end s0, i0 = [], index loop do if input.index(Regexp.new('[\\s]'), index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r1 = nil end if r1 s0 << r1 else break end end r0 = SyntaxNode.new(input, i0...index, s0) node_cache[:space][start_index] = r0 return r0 end |
#_nt_space_hard ⇒ Object
3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3365 def _nt_space_hard start_index = index if node_cache[:space_hard].has_key?(index) cached = node_cache[:space_hard][index] @index = cached.interval.end if cached return cached end s0, i0 = [], index loop do if input.index(Regexp.new('[\\s]'), index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r1 = nil end if r1 s0 << r1 else break end end if s0.empty? self.index = i0 r0 = nil else r0 = SyntaxNode.new(input, i0...index, s0) end node_cache[:space_hard][start_index] = r0 return r0 end |
#_nt_species_name ⇒ Object
2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 2859 def _nt_species_name start_index = index if node_cache[:species_name].has_key?(index) cached = node_cache[:species_name][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_hybrid_separator s1 << r2 if r2 r3 = _nt_space_hard s1 << r3 if r3 r4 = _nt_cap_latin_word s1 << r4 if r4 r5 = _nt_space_hard s1 << r5 if r5 r6 = _nt_latin_word s1 << r6 end end end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(SpeciesName0) r1.extend(SpeciesName1) else self.index = i1 r1 = nil end if r1 r0 = r1 else i7, s7 = index, [] r8 = _nt_hybrid_separator s7 << r8 if r8 r9 = _nt_space_hard s7 << r9 if r9 r10 = _nt_cap_latin_word s7 << r10 end end if s7.last r7 = (SyntaxNode).new(input, i7...index, s7) r7.extend(SpeciesName2) r7.extend(SpeciesName3) else self.index = i7 r7 = nil end if r7 r0 = r7 else i11, s11 = index, [] r12 = _nt_cap_latin_word s11 << r12 if r12 r13 = _nt_space_hard s11 << r13 if r13 r14 = _nt_hybrid_separator s11 << r14 if r14 r15 = _nt_space_hard s11 << r15 if r15 r16 = _nt_latin_word s11 << r16 end end end end if s11.last r11 = (SyntaxNode).new(input, i11...index, s11) r11.extend(SpeciesName4) r11.extend(SpeciesName5) else self.index = i11 r11 = nil end if r11 r0 = r11 else i17, s17 = index, [] r18 = _nt_cap_latin_word s17 << r18 if r18 r19 = _nt_space_hard s17 << r19 if r19 r20 = _nt_subgenus s17 << r20 if r20 r21 = _nt_space_hard s17 << r21 if r21 r22 = _nt_latin_word s17 << r22 end end end end if s17.last r17 = (SyntaxNode).new(input, i17...index, s17) r17.extend(SpeciesName6) r17.extend(SpeciesName7) else self.index = i17 r17 = nil end if r17 r0 = r17 else i23, s23 = index, [] r24 = _nt_cap_latin_word s23 << r24 if r24 r25 = _nt_space_hard s23 << r25 if r25 r26 = _nt_latin_word s23 << r26 end end if s23.last r23 = (SyntaxNode).new(input, i23...index, s23) r23.extend(SpeciesName8) r23.extend(SpeciesName9) else self.index = i23 r23 = nil end if r23 r0 = r23 else self.index = i0 r0 = nil end end end end end node_cache[:species_name][start_index] = r0 return r0 end |
#_nt_status_part ⇒ Object
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 435 def _nt_status_part start_index = index if node_cache[:status_part].has_key?(index) cached = node_cache[:status_part][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_status_word s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 r4 = _nt_status_part s1 << r4 end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(StatusPart0) r1.extend(StatusPart1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r5 = _nt_status_word if r5 r0 = r5 else self.index = i0 r0 = nil end end node_cache[:status_part][start_index] = r0 return r0 end |
#_nt_status_word ⇒ Object
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 496 def _nt_status_word start_index = index if node_cache[:status_word].has_key?(index) cached = node_cache[:status_word][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_latin_word s1 << r2 if r2 if input.index(Regexp.new('[\\.]'), index) == index r3 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r3 = nil end s1 << r3 end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(StatusWord0) r1.extend(StatusWord1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r4 = _nt_latin_word if r4 r0 = r4 else self.index = i0 r0 = nil end end node_cache[:status_word][start_index] = r0 return r0 end |
#_nt_subgenus ⇒ Object
3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3039 def _nt_subgenus start_index = index if node_cache[:subgenus].has_key?(index) cached = node_cache[:subgenus][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] if input.index("(", index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure("(") r1 = nil end s0 << r1 if r1 r2 = _nt_space s0 << r2 if r2 r3 = _nt_cap_latin_word s0 << r3 if r3 r4 = _nt_space s0 << r4 if r4 if input.index(")", index) == index r5 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else terminal_parse_failure(")") r5 = nil end s0 << r5 end end end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(Subgenus0) r0.extend(Subgenus1) else self.index = i0 r0 = nil end node_cache[:subgenus][start_index] = r0 return r0 end |
#_nt_subspecies_name ⇒ Object
2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 2071 def _nt_subspecies_name start_index = index if node_cache[:subspecies_name].has_key?(index) cached = node_cache[:subspecies_name][index] @index = cached.interval.end if cached return cached end i0, s0 = index, [] r1 = _nt_selector s0 << r1 if r1 r2 = _nt_space_hard s0 << r2 if r2 r3 = _nt_latin_word s0 << r3 end end if s0.last r0 = (SyntaxNode).new(input, i0...index, s0) r0.extend(SubspeciesName0) r0.extend(SubspeciesName1) else self.index = i0 r0 = nil end node_cache[:subspecies_name][start_index] = r0 return r0 end |
#_nt_subspecies_names ⇒ Object
1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 1997 def _nt_subspecies_names start_index = index if node_cache[:subspecies_names].has_key?(index) cached = node_cache[:subspecies_names][index] @index = cached.interval.end if cached return cached end i0 = index i1, s1 = index, [] r2 = _nt_subspecies_name s1 << r2 if r2 r3 = _nt_space s1 << r3 if r3 r4 = _nt_subspecies_names s1 << r4 end end if s1.last r1 = (SyntaxNode).new(input, i1...index, s1) r1.extend(SubspeciesNames0) r1.extend(SubspeciesNames1) else self.index = i1 r1 = nil end if r1 r0 = r1 else r5 = _nt_subspecies_name if r5 r0 = r5 else self.index = i0 r0 = nil end end node_cache[:subspecies_names][start_index] = r0 return r0 end |
#_nt_year ⇒ Object
3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 3301 def _nt_year start_index = index if node_cache[:year].has_key?(index) cached = node_cache[:year][index] @index = cached.interval.end if cached return cached end s0, i0 = [], index loop do if input.index(Regexp.new('[0-9\\?]'), index) == index r1 = (SyntaxNode).new(input, index...(index + 1)) @index += 1 else r1 = nil end if r1 s0 << r1 else break end end if s0.empty? self.index = i0 r0 = nil else r0 = SyntaxNode.new(input, i0...index, s0) r0.extend(Year0) end node_cache[:year][start_index] = r0 return r0 end |
#root ⇒ Object
4 5 6 |
# File 'lib/biodiversity/parser/scientific_name.rb', line 4 def root @root || :composite_scientific_name end |