/usr/lib/python3/dist-packages/libhfst.py is in python3-libhfst 3.13.0~r3461-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 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 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 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 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 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 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 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 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 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 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 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 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 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 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 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 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 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 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 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 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 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 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 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 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 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 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 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 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 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 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 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 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 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 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 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 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 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 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 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 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 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 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 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 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 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 3232 3233 3234 3235 3236 3237 3238 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 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 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 3335 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 3364 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 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_libhfst')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_libhfst')
_libhfst = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_libhfst', [dirname(__file__)])
except ImportError:
import _libhfst
return _libhfst
try:
_mod = imp.load_module('_libhfst', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_libhfst = swig_import_helper()
del swig_import_helper
else:
import _libhfst
del _swig_python_version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr(self, class_type, name):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except __builtin__.Exception:
class _object:
pass
_newclass = 0
class SwigPyIterator(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _libhfst.delete_SwigPyIterator
__del__ = lambda self: None
def value(self):
return _libhfst.SwigPyIterator_value(self)
def incr(self, n=1):
return _libhfst.SwigPyIterator_incr(self, n)
def decr(self, n=1):
return _libhfst.SwigPyIterator_decr(self, n)
def distance(self, x):
return _libhfst.SwigPyIterator_distance(self, x)
def equal(self, x):
return _libhfst.SwigPyIterator_equal(self, x)
def copy(self):
return _libhfst.SwigPyIterator_copy(self)
def next(self):
return _libhfst.SwigPyIterator_next(self)
def __next__(self):
return _libhfst.SwigPyIterator___next__(self)
def previous(self):
return _libhfst.SwigPyIterator_previous(self)
def advance(self, n):
return _libhfst.SwigPyIterator_advance(self, n)
def __eq__(self, x):
return _libhfst.SwigPyIterator___eq__(self, x)
def __ne__(self, x):
return _libhfst.SwigPyIterator___ne__(self, x)
def __iadd__(self, n):
return _libhfst.SwigPyIterator___iadd__(self, n)
def __isub__(self, n):
return _libhfst.SwigPyIterator___isub__(self, n)
def __add__(self, n):
return _libhfst.SwigPyIterator___add__(self, n)
def __sub__(self, *args):
return _libhfst.SwigPyIterator___sub__(self, *args)
def __iter__(self):
return self
SwigPyIterator_swigregister = _libhfst.SwigPyIterator_swigregister
SwigPyIterator_swigregister(SwigPyIterator)
class StringVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, StringVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, StringVector, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.StringVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.StringVector___nonzero__(self)
def __bool__(self):
return _libhfst.StringVector___bool__(self)
def __len__(self):
return _libhfst.StringVector___len__(self)
def __getslice__(self, i, j):
return _libhfst.StringVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.StringVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.StringVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.StringVector___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.StringVector___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.StringVector___setitem__(self, *args)
def pop(self):
return _libhfst.StringVector_pop(self)
def append(self, x):
return _libhfst.StringVector_append(self, x)
def empty(self):
return _libhfst.StringVector_empty(self)
def size(self):
return _libhfst.StringVector_size(self)
def swap(self, v):
return _libhfst.StringVector_swap(self, v)
def begin(self):
return _libhfst.StringVector_begin(self)
def end(self):
return _libhfst.StringVector_end(self)
def rbegin(self):
return _libhfst.StringVector_rbegin(self)
def rend(self):
return _libhfst.StringVector_rend(self)
def clear(self):
return _libhfst.StringVector_clear(self)
def get_allocator(self):
return _libhfst.StringVector_get_allocator(self)
def pop_back(self):
return _libhfst.StringVector_pop_back(self)
def erase(self, *args):
return _libhfst.StringVector_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_StringVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.StringVector_push_back(self, x)
def front(self):
return _libhfst.StringVector_front(self)
def back(self):
return _libhfst.StringVector_back(self)
def assign(self, n, x):
return _libhfst.StringVector_assign(self, n, x)
def resize(self, *args):
return _libhfst.StringVector_resize(self, *args)
def insert(self, *args):
return _libhfst.StringVector_insert(self, *args)
def reserve(self, n):
return _libhfst.StringVector_reserve(self, n)
def capacity(self):
return _libhfst.StringVector_capacity(self)
__swig_destroy__ = _libhfst.delete_StringVector
__del__ = lambda self: None
StringVector_swigregister = _libhfst.StringVector_swigregister
StringVector_swigregister(StringVector)
class StringPair(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, StringPair, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, StringPair, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_StringPair(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_setmethods__["first"] = _libhfst.StringPair_first_set
__swig_getmethods__["first"] = _libhfst.StringPair_first_get
if _newclass:
first = _swig_property(_libhfst.StringPair_first_get, _libhfst.StringPair_first_set)
__swig_setmethods__["second"] = _libhfst.StringPair_second_set
__swig_getmethods__["second"] = _libhfst.StringPair_second_get
if _newclass:
second = _swig_property(_libhfst.StringPair_second_get, _libhfst.StringPair_second_set)
def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
def __getitem__(self, index):
if not (index % 2):
return self.first
else:
return self.second
def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val
__swig_destroy__ = _libhfst.delete_StringPair
__del__ = lambda self: None
StringPair_swigregister = _libhfst.StringPair_swigregister
StringPair_swigregister(StringPair)
class StringPairVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, StringPairVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, StringPairVector, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.StringPairVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.StringPairVector___nonzero__(self)
def __bool__(self):
return _libhfst.StringPairVector___bool__(self)
def __len__(self):
return _libhfst.StringPairVector___len__(self)
def __getslice__(self, i, j):
return _libhfst.StringPairVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.StringPairVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.StringPairVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.StringPairVector___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.StringPairVector___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.StringPairVector___setitem__(self, *args)
def pop(self):
return _libhfst.StringPairVector_pop(self)
def append(self, x):
return _libhfst.StringPairVector_append(self, x)
def empty(self):
return _libhfst.StringPairVector_empty(self)
def size(self):
return _libhfst.StringPairVector_size(self)
def swap(self, v):
return _libhfst.StringPairVector_swap(self, v)
def begin(self):
return _libhfst.StringPairVector_begin(self)
def end(self):
return _libhfst.StringPairVector_end(self)
def rbegin(self):
return _libhfst.StringPairVector_rbegin(self)
def rend(self):
return _libhfst.StringPairVector_rend(self)
def clear(self):
return _libhfst.StringPairVector_clear(self)
def get_allocator(self):
return _libhfst.StringPairVector_get_allocator(self)
def pop_back(self):
return _libhfst.StringPairVector_pop_back(self)
def erase(self, *args):
return _libhfst.StringPairVector_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_StringPairVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.StringPairVector_push_back(self, x)
def front(self):
return _libhfst.StringPairVector_front(self)
def back(self):
return _libhfst.StringPairVector_back(self)
def assign(self, n, x):
return _libhfst.StringPairVector_assign(self, n, x)
def resize(self, *args):
return _libhfst.StringPairVector_resize(self, *args)
def insert(self, *args):
return _libhfst.StringPairVector_insert(self, *args)
def reserve(self, n):
return _libhfst.StringPairVector_reserve(self, n)
def capacity(self):
return _libhfst.StringPairVector_capacity(self)
__swig_destroy__ = _libhfst.delete_StringPairVector
__del__ = lambda self: None
StringPairVector_swigregister = _libhfst.StringPairVector_swigregister
StringPairVector_swigregister(StringPairVector)
class FloatVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, FloatVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, FloatVector, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.FloatVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.FloatVector___nonzero__(self)
def __bool__(self):
return _libhfst.FloatVector___bool__(self)
def __len__(self):
return _libhfst.FloatVector___len__(self)
def __getslice__(self, i, j):
return _libhfst.FloatVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.FloatVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.FloatVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.FloatVector___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.FloatVector___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.FloatVector___setitem__(self, *args)
def pop(self):
return _libhfst.FloatVector_pop(self)
def append(self, x):
return _libhfst.FloatVector_append(self, x)
def empty(self):
return _libhfst.FloatVector_empty(self)
def size(self):
return _libhfst.FloatVector_size(self)
def swap(self, v):
return _libhfst.FloatVector_swap(self, v)
def begin(self):
return _libhfst.FloatVector_begin(self)
def end(self):
return _libhfst.FloatVector_end(self)
def rbegin(self):
return _libhfst.FloatVector_rbegin(self)
def rend(self):
return _libhfst.FloatVector_rend(self)
def clear(self):
return _libhfst.FloatVector_clear(self)
def get_allocator(self):
return _libhfst.FloatVector_get_allocator(self)
def pop_back(self):
return _libhfst.FloatVector_pop_back(self)
def erase(self, *args):
return _libhfst.FloatVector_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_FloatVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.FloatVector_push_back(self, x)
def front(self):
return _libhfst.FloatVector_front(self)
def back(self):
return _libhfst.FloatVector_back(self)
def assign(self, n, x):
return _libhfst.FloatVector_assign(self, n, x)
def resize(self, *args):
return _libhfst.FloatVector_resize(self, *args)
def insert(self, *args):
return _libhfst.FloatVector_insert(self, *args)
def reserve(self, n):
return _libhfst.FloatVector_reserve(self, n)
def capacity(self):
return _libhfst.FloatVector_capacity(self)
__swig_destroy__ = _libhfst.delete_FloatVector
__del__ = lambda self: None
FloatVector_swigregister = _libhfst.FloatVector_swigregister
FloatVector_swigregister(FloatVector)
class StringSet(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, StringSet, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, StringSet, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.StringSet_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.StringSet___nonzero__(self)
def __bool__(self):
return _libhfst.StringSet___bool__(self)
def __len__(self):
return _libhfst.StringSet___len__(self)
def append(self, x):
return _libhfst.StringSet_append(self, x)
def __contains__(self, x):
return _libhfst.StringSet___contains__(self, x)
def __getitem__(self, i):
return _libhfst.StringSet___getitem__(self, i)
def add(self, x):
return _libhfst.StringSet_add(self, x)
def discard(self, x):
return _libhfst.StringSet_discard(self, x)
def __init__(self, *args):
this = _libhfst.new_StringSet(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def empty(self):
return _libhfst.StringSet_empty(self)
def size(self):
return _libhfst.StringSet_size(self)
def clear(self):
return _libhfst.StringSet_clear(self)
def swap(self, v):
return _libhfst.StringSet_swap(self, v)
def count(self, x):
return _libhfst.StringSet_count(self, x)
def begin(self):
return _libhfst.StringSet_begin(self)
def end(self):
return _libhfst.StringSet_end(self)
def rbegin(self):
return _libhfst.StringSet_rbegin(self)
def rend(self):
return _libhfst.StringSet_rend(self)
def erase(self, *args):
return _libhfst.StringSet_erase(self, *args)
def find(self, x):
return _libhfst.StringSet_find(self, x)
def lower_bound(self, x):
return _libhfst.StringSet_lower_bound(self, x)
def upper_bound(self, x):
return _libhfst.StringSet_upper_bound(self, x)
def equal_range(self, x):
return _libhfst.StringSet_equal_range(self, x)
def insert(self, __x):
return _libhfst.StringSet_insert(self, __x)
__swig_destroy__ = _libhfst.delete_StringSet
__del__ = lambda self: None
StringSet_swigregister = _libhfst.StringSet_swigregister
StringSet_swigregister(StringSet)
class StringPairSet(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, StringPairSet, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, StringPairSet, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.StringPairSet_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.StringPairSet___nonzero__(self)
def __bool__(self):
return _libhfst.StringPairSet___bool__(self)
def __len__(self):
return _libhfst.StringPairSet___len__(self)
def append(self, x):
return _libhfst.StringPairSet_append(self, x)
def __contains__(self, x):
return _libhfst.StringPairSet___contains__(self, x)
def __getitem__(self, i):
return _libhfst.StringPairSet___getitem__(self, i)
def add(self, x):
return _libhfst.StringPairSet_add(self, x)
def discard(self, x):
return _libhfst.StringPairSet_discard(self, x)
def __init__(self, *args):
this = _libhfst.new_StringPairSet(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def empty(self):
return _libhfst.StringPairSet_empty(self)
def size(self):
return _libhfst.StringPairSet_size(self)
def clear(self):
return _libhfst.StringPairSet_clear(self)
def swap(self, v):
return _libhfst.StringPairSet_swap(self, v)
def count(self, x):
return _libhfst.StringPairSet_count(self, x)
def begin(self):
return _libhfst.StringPairSet_begin(self)
def end(self):
return _libhfst.StringPairSet_end(self)
def rbegin(self):
return _libhfst.StringPairSet_rbegin(self)
def rend(self):
return _libhfst.StringPairSet_rend(self)
def erase(self, *args):
return _libhfst.StringPairSet_erase(self, *args)
def find(self, x):
return _libhfst.StringPairSet_find(self, x)
def lower_bound(self, x):
return _libhfst.StringPairSet_lower_bound(self, x)
def upper_bound(self, x):
return _libhfst.StringPairSet_upper_bound(self, x)
def equal_range(self, x):
return _libhfst.StringPairSet_equal_range(self, x)
def insert(self, __x):
return _libhfst.StringPairSet_insert(self, __x)
__swig_destroy__ = _libhfst.delete_StringPairSet
__del__ = lambda self: None
StringPairSet_swigregister = _libhfst.StringPairSet_swigregister
StringPairSet_swigregister(StringPairSet)
class HfstTransducerVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTransducerVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTransducerVector, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstTransducerVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstTransducerVector___nonzero__(self)
def __bool__(self):
return _libhfst.HfstTransducerVector___bool__(self)
def __len__(self):
return _libhfst.HfstTransducerVector___len__(self)
def __getslice__(self, i, j):
return _libhfst.HfstTransducerVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.HfstTransducerVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.HfstTransducerVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.HfstTransducerVector___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.HfstTransducerVector___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.HfstTransducerVector___setitem__(self, *args)
def pop(self):
return _libhfst.HfstTransducerVector_pop(self)
def append(self, x):
return _libhfst.HfstTransducerVector_append(self, x)
def empty(self):
return _libhfst.HfstTransducerVector_empty(self)
def size(self):
return _libhfst.HfstTransducerVector_size(self)
def swap(self, v):
return _libhfst.HfstTransducerVector_swap(self, v)
def begin(self):
return _libhfst.HfstTransducerVector_begin(self)
def end(self):
return _libhfst.HfstTransducerVector_end(self)
def rbegin(self):
return _libhfst.HfstTransducerVector_rbegin(self)
def rend(self):
return _libhfst.HfstTransducerVector_rend(self)
def clear(self):
return _libhfst.HfstTransducerVector_clear(self)
def get_allocator(self):
return _libhfst.HfstTransducerVector_get_allocator(self)
def pop_back(self):
return _libhfst.HfstTransducerVector_pop_back(self)
def erase(self, *args):
return _libhfst.HfstTransducerVector_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_HfstTransducerVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.HfstTransducerVector_push_back(self, x)
def front(self):
return _libhfst.HfstTransducerVector_front(self)
def back(self):
return _libhfst.HfstTransducerVector_back(self)
def assign(self, n, x):
return _libhfst.HfstTransducerVector_assign(self, n, x)
def resize(self, *args):
return _libhfst.HfstTransducerVector_resize(self, *args)
def insert(self, *args):
return _libhfst.HfstTransducerVector_insert(self, *args)
def reserve(self, n):
return _libhfst.HfstTransducerVector_reserve(self, n)
def capacity(self):
return _libhfst.HfstTransducerVector_capacity(self)
__swig_destroy__ = _libhfst.delete_HfstTransducerVector
__del__ = lambda self: None
HfstTransducerVector_swigregister = _libhfst.HfstTransducerVector_swigregister
HfstTransducerVector_swigregister(HfstTransducerVector)
class HfstSymbolSubstitutions(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstSymbolSubstitutions, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstSymbolSubstitutions, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstSymbolSubstitutions_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstSymbolSubstitutions___nonzero__(self)
def __bool__(self):
return _libhfst.HfstSymbolSubstitutions___bool__(self)
def __len__(self):
return _libhfst.HfstSymbolSubstitutions___len__(self)
def __iter__(self):
return self.key_iterator()
def iterkeys(self):
return self.key_iterator()
def itervalues(self):
return self.value_iterator()
def iteritems(self):
return self.iterator()
def __getitem__(self, key):
return _libhfst.HfstSymbolSubstitutions___getitem__(self, key)
def __delitem__(self, key):
return _libhfst.HfstSymbolSubstitutions___delitem__(self, key)
def has_key(self, key):
return _libhfst.HfstSymbolSubstitutions_has_key(self, key)
def keys(self):
return _libhfst.HfstSymbolSubstitutions_keys(self)
def values(self):
return _libhfst.HfstSymbolSubstitutions_values(self)
def items(self):
return _libhfst.HfstSymbolSubstitutions_items(self)
def __contains__(self, key):
return _libhfst.HfstSymbolSubstitutions___contains__(self, key)
def key_iterator(self):
return _libhfst.HfstSymbolSubstitutions_key_iterator(self)
def value_iterator(self):
return _libhfst.HfstSymbolSubstitutions_value_iterator(self)
def __setitem__(self, *args):
return _libhfst.HfstSymbolSubstitutions___setitem__(self, *args)
def asdict(self):
return _libhfst.HfstSymbolSubstitutions_asdict(self)
def __init__(self, *args):
this = _libhfst.new_HfstSymbolSubstitutions(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def empty(self):
return _libhfst.HfstSymbolSubstitutions_empty(self)
def size(self):
return _libhfst.HfstSymbolSubstitutions_size(self)
def swap(self, v):
return _libhfst.HfstSymbolSubstitutions_swap(self, v)
def begin(self):
return _libhfst.HfstSymbolSubstitutions_begin(self)
def end(self):
return _libhfst.HfstSymbolSubstitutions_end(self)
def rbegin(self):
return _libhfst.HfstSymbolSubstitutions_rbegin(self)
def rend(self):
return _libhfst.HfstSymbolSubstitutions_rend(self)
def clear(self):
return _libhfst.HfstSymbolSubstitutions_clear(self)
def get_allocator(self):
return _libhfst.HfstSymbolSubstitutions_get_allocator(self)
def count(self, x):
return _libhfst.HfstSymbolSubstitutions_count(self, x)
def erase(self, *args):
return _libhfst.HfstSymbolSubstitutions_erase(self, *args)
def find(self, x):
return _libhfst.HfstSymbolSubstitutions_find(self, x)
def lower_bound(self, x):
return _libhfst.HfstSymbolSubstitutions_lower_bound(self, x)
def upper_bound(self, x):
return _libhfst.HfstSymbolSubstitutions_upper_bound(self, x)
__swig_destroy__ = _libhfst.delete_HfstSymbolSubstitutions
__del__ = lambda self: None
HfstSymbolSubstitutions_swigregister = _libhfst.HfstSymbolSubstitutions_swigregister
HfstSymbolSubstitutions_swigregister(HfstSymbolSubstitutions)
class HfstSymbolPairSubstitutions(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstSymbolPairSubstitutions, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstSymbolPairSubstitutions, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstSymbolPairSubstitutions_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstSymbolPairSubstitutions___nonzero__(self)
def __bool__(self):
return _libhfst.HfstSymbolPairSubstitutions___bool__(self)
def __len__(self):
return _libhfst.HfstSymbolPairSubstitutions___len__(self)
def __iter__(self):
return self.key_iterator()
def iterkeys(self):
return self.key_iterator()
def itervalues(self):
return self.value_iterator()
def iteritems(self):
return self.iterator()
def __getitem__(self, key):
return _libhfst.HfstSymbolPairSubstitutions___getitem__(self, key)
def __delitem__(self, key):
return _libhfst.HfstSymbolPairSubstitutions___delitem__(self, key)
def has_key(self, key):
return _libhfst.HfstSymbolPairSubstitutions_has_key(self, key)
def keys(self):
return _libhfst.HfstSymbolPairSubstitutions_keys(self)
def values(self):
return _libhfst.HfstSymbolPairSubstitutions_values(self)
def items(self):
return _libhfst.HfstSymbolPairSubstitutions_items(self)
def __contains__(self, key):
return _libhfst.HfstSymbolPairSubstitutions___contains__(self, key)
def key_iterator(self):
return _libhfst.HfstSymbolPairSubstitutions_key_iterator(self)
def value_iterator(self):
return _libhfst.HfstSymbolPairSubstitutions_value_iterator(self)
def __setitem__(self, *args):
return _libhfst.HfstSymbolPairSubstitutions___setitem__(self, *args)
def asdict(self):
return _libhfst.HfstSymbolPairSubstitutions_asdict(self)
def __init__(self, *args):
this = _libhfst.new_HfstSymbolPairSubstitutions(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def empty(self):
return _libhfst.HfstSymbolPairSubstitutions_empty(self)
def size(self):
return _libhfst.HfstSymbolPairSubstitutions_size(self)
def swap(self, v):
return _libhfst.HfstSymbolPairSubstitutions_swap(self, v)
def begin(self):
return _libhfst.HfstSymbolPairSubstitutions_begin(self)
def end(self):
return _libhfst.HfstSymbolPairSubstitutions_end(self)
def rbegin(self):
return _libhfst.HfstSymbolPairSubstitutions_rbegin(self)
def rend(self):
return _libhfst.HfstSymbolPairSubstitutions_rend(self)
def clear(self):
return _libhfst.HfstSymbolPairSubstitutions_clear(self)
def get_allocator(self):
return _libhfst.HfstSymbolPairSubstitutions_get_allocator(self)
def count(self, x):
return _libhfst.HfstSymbolPairSubstitutions_count(self, x)
def erase(self, *args):
return _libhfst.HfstSymbolPairSubstitutions_erase(self, *args)
def find(self, x):
return _libhfst.HfstSymbolPairSubstitutions_find(self, x)
def lower_bound(self, x):
return _libhfst.HfstSymbolPairSubstitutions_lower_bound(self, x)
def upper_bound(self, x):
return _libhfst.HfstSymbolPairSubstitutions_upper_bound(self, x)
__swig_destroy__ = _libhfst.delete_HfstSymbolPairSubstitutions
__del__ = lambda self: None
HfstSymbolPairSubstitutions_swigregister = _libhfst.HfstSymbolPairSubstitutions_swigregister
HfstSymbolPairSubstitutions_swigregister(HfstSymbolPairSubstitutions)
class BarBazFoo(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, BarBazFoo, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, BarBazFoo, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.BarBazFoo_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.BarBazFoo___nonzero__(self)
def __bool__(self):
return _libhfst.BarBazFoo___bool__(self)
def __len__(self):
return _libhfst.BarBazFoo___len__(self)
def __getslice__(self, i, j):
return _libhfst.BarBazFoo___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.BarBazFoo___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.BarBazFoo___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.BarBazFoo___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.BarBazFoo___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.BarBazFoo___setitem__(self, *args)
def pop(self):
return _libhfst.BarBazFoo_pop(self)
def append(self, x):
return _libhfst.BarBazFoo_append(self, x)
def empty(self):
return _libhfst.BarBazFoo_empty(self)
def size(self):
return _libhfst.BarBazFoo_size(self)
def swap(self, v):
return _libhfst.BarBazFoo_swap(self, v)
def begin(self):
return _libhfst.BarBazFoo_begin(self)
def end(self):
return _libhfst.BarBazFoo_end(self)
def rbegin(self):
return _libhfst.BarBazFoo_rbegin(self)
def rend(self):
return _libhfst.BarBazFoo_rend(self)
def clear(self):
return _libhfst.BarBazFoo_clear(self)
def get_allocator(self):
return _libhfst.BarBazFoo_get_allocator(self)
def pop_back(self):
return _libhfst.BarBazFoo_pop_back(self)
def erase(self, *args):
return _libhfst.BarBazFoo_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_BarBazFoo(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.BarBazFoo_push_back(self, x)
def front(self):
return _libhfst.BarBazFoo_front(self)
def back(self):
return _libhfst.BarBazFoo_back(self)
def assign(self, n, x):
return _libhfst.BarBazFoo_assign(self, n, x)
def resize(self, *args):
return _libhfst.BarBazFoo_resize(self, *args)
def insert(self, *args):
return _libhfst.BarBazFoo_insert(self, *args)
def reserve(self, n):
return _libhfst.BarBazFoo_reserve(self, n)
def capacity(self):
return _libhfst.BarBazFoo_capacity(self)
__swig_destroy__ = _libhfst.delete_BarBazFoo
__del__ = lambda self: None
BarBazFoo_swigregister = _libhfst.BarBazFoo_swigregister
BarBazFoo_swigregister(BarBazFoo)
class HfstBasicTransitions(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstBasicTransitions, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstBasicTransitions, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstBasicTransitions_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstBasicTransitions___nonzero__(self)
def __bool__(self):
return _libhfst.HfstBasicTransitions___bool__(self)
def __len__(self):
return _libhfst.HfstBasicTransitions___len__(self)
def __getslice__(self, i, j):
return _libhfst.HfstBasicTransitions___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.HfstBasicTransitions___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.HfstBasicTransitions___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.HfstBasicTransitions___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.HfstBasicTransitions___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.HfstBasicTransitions___setitem__(self, *args)
def pop(self):
return _libhfst.HfstBasicTransitions_pop(self)
def append(self, x):
return _libhfst.HfstBasicTransitions_append(self, x)
def empty(self):
return _libhfst.HfstBasicTransitions_empty(self)
def size(self):
return _libhfst.HfstBasicTransitions_size(self)
def swap(self, v):
return _libhfst.HfstBasicTransitions_swap(self, v)
def begin(self):
return _libhfst.HfstBasicTransitions_begin(self)
def end(self):
return _libhfst.HfstBasicTransitions_end(self)
def rbegin(self):
return _libhfst.HfstBasicTransitions_rbegin(self)
def rend(self):
return _libhfst.HfstBasicTransitions_rend(self)
def clear(self):
return _libhfst.HfstBasicTransitions_clear(self)
def get_allocator(self):
return _libhfst.HfstBasicTransitions_get_allocator(self)
def pop_back(self):
return _libhfst.HfstBasicTransitions_pop_back(self)
def erase(self, *args):
return _libhfst.HfstBasicTransitions_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_HfstBasicTransitions(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.HfstBasicTransitions_push_back(self, x)
def front(self):
return _libhfst.HfstBasicTransitions_front(self)
def back(self):
return _libhfst.HfstBasicTransitions_back(self)
def assign(self, n, x):
return _libhfst.HfstBasicTransitions_assign(self, n, x)
def resize(self, *args):
return _libhfst.HfstBasicTransitions_resize(self, *args)
def insert(self, *args):
return _libhfst.HfstBasicTransitions_insert(self, *args)
def reserve(self, n):
return _libhfst.HfstBasicTransitions_reserve(self, n)
def capacity(self):
return _libhfst.HfstBasicTransitions_capacity(self)
__swig_destroy__ = _libhfst.delete_HfstBasicTransitions
__del__ = lambda self: None
HfstBasicTransitions_swigregister = _libhfst.HfstBasicTransitions_swigregister
HfstBasicTransitions_swigregister(HfstBasicTransitions)
class HfstOneLevelPath(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstOneLevelPath, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstOneLevelPath, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstOneLevelPath(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_setmethods__["first"] = _libhfst.HfstOneLevelPath_first_set
__swig_getmethods__["first"] = _libhfst.HfstOneLevelPath_first_get
if _newclass:
first = _swig_property(_libhfst.HfstOneLevelPath_first_get, _libhfst.HfstOneLevelPath_first_set)
__swig_setmethods__["second"] = _libhfst.HfstOneLevelPath_second_set
__swig_getmethods__["second"] = _libhfst.HfstOneLevelPath_second_get
if _newclass:
second = _swig_property(_libhfst.HfstOneLevelPath_second_get, _libhfst.HfstOneLevelPath_second_set)
def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
def __getitem__(self, index):
if not (index % 2):
return self.first
else:
return self.second
def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val
__swig_destroy__ = _libhfst.delete_HfstOneLevelPath
__del__ = lambda self: None
HfstOneLevelPath_swigregister = _libhfst.HfstOneLevelPath_swigregister
HfstOneLevelPath_swigregister(HfstOneLevelPath)
class HfstOneLevelPaths(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstOneLevelPaths, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstOneLevelPaths, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstOneLevelPaths_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstOneLevelPaths___nonzero__(self)
def __bool__(self):
return _libhfst.HfstOneLevelPaths___bool__(self)
def __len__(self):
return _libhfst.HfstOneLevelPaths___len__(self)
def append(self, x):
return _libhfst.HfstOneLevelPaths_append(self, x)
def __contains__(self, x):
return _libhfst.HfstOneLevelPaths___contains__(self, x)
def __getitem__(self, i):
return _libhfst.HfstOneLevelPaths___getitem__(self, i)
def add(self, x):
return _libhfst.HfstOneLevelPaths_add(self, x)
def discard(self, x):
return _libhfst.HfstOneLevelPaths_discard(self, x)
def __init__(self, *args):
this = _libhfst.new_HfstOneLevelPaths(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def empty(self):
return _libhfst.HfstOneLevelPaths_empty(self)
def size(self):
return _libhfst.HfstOneLevelPaths_size(self)
def clear(self):
return _libhfst.HfstOneLevelPaths_clear(self)
def swap(self, v):
return _libhfst.HfstOneLevelPaths_swap(self, v)
def count(self, x):
return _libhfst.HfstOneLevelPaths_count(self, x)
def begin(self):
return _libhfst.HfstOneLevelPaths_begin(self)
def end(self):
return _libhfst.HfstOneLevelPaths_end(self)
def rbegin(self):
return _libhfst.HfstOneLevelPaths_rbegin(self)
def rend(self):
return _libhfst.HfstOneLevelPaths_rend(self)
def erase(self, *args):
return _libhfst.HfstOneLevelPaths_erase(self, *args)
def find(self, x):
return _libhfst.HfstOneLevelPaths_find(self, x)
def lower_bound(self, x):
return _libhfst.HfstOneLevelPaths_lower_bound(self, x)
def upper_bound(self, x):
return _libhfst.HfstOneLevelPaths_upper_bound(self, x)
def equal_range(self, x):
return _libhfst.HfstOneLevelPaths_equal_range(self, x)
def insert(self, __x):
return _libhfst.HfstOneLevelPaths_insert(self, __x)
__swig_destroy__ = _libhfst.delete_HfstOneLevelPaths
__del__ = lambda self: None
HfstOneLevelPaths_swigregister = _libhfst.HfstOneLevelPaths_swigregister
HfstOneLevelPaths_swigregister(HfstOneLevelPaths)
class HfstTwoLevelPath(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTwoLevelPath, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTwoLevelPath, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstTwoLevelPath(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_setmethods__["first"] = _libhfst.HfstTwoLevelPath_first_set
__swig_getmethods__["first"] = _libhfst.HfstTwoLevelPath_first_get
if _newclass:
first = _swig_property(_libhfst.HfstTwoLevelPath_first_get, _libhfst.HfstTwoLevelPath_first_set)
__swig_setmethods__["second"] = _libhfst.HfstTwoLevelPath_second_set
__swig_getmethods__["second"] = _libhfst.HfstTwoLevelPath_second_get
if _newclass:
second = _swig_property(_libhfst.HfstTwoLevelPath_second_get, _libhfst.HfstTwoLevelPath_second_set)
def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
def __getitem__(self, index):
if not (index % 2):
return self.first
else:
return self.second
def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val
__swig_destroy__ = _libhfst.delete_HfstTwoLevelPath
__del__ = lambda self: None
HfstTwoLevelPath_swigregister = _libhfst.HfstTwoLevelPath_swigregister
HfstTwoLevelPath_swigregister(HfstTwoLevelPath)
class HfstTwoLevelPaths(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTwoLevelPaths, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTwoLevelPaths, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstTwoLevelPaths_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstTwoLevelPaths___nonzero__(self)
def __bool__(self):
return _libhfst.HfstTwoLevelPaths___bool__(self)
def __len__(self):
return _libhfst.HfstTwoLevelPaths___len__(self)
def append(self, x):
return _libhfst.HfstTwoLevelPaths_append(self, x)
def __contains__(self, x):
return _libhfst.HfstTwoLevelPaths___contains__(self, x)
def __getitem__(self, i):
return _libhfst.HfstTwoLevelPaths___getitem__(self, i)
def add(self, x):
return _libhfst.HfstTwoLevelPaths_add(self, x)
def discard(self, x):
return _libhfst.HfstTwoLevelPaths_discard(self, x)
def __init__(self, *args):
this = _libhfst.new_HfstTwoLevelPaths(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def empty(self):
return _libhfst.HfstTwoLevelPaths_empty(self)
def size(self):
return _libhfst.HfstTwoLevelPaths_size(self)
def clear(self):
return _libhfst.HfstTwoLevelPaths_clear(self)
def swap(self, v):
return _libhfst.HfstTwoLevelPaths_swap(self, v)
def count(self, x):
return _libhfst.HfstTwoLevelPaths_count(self, x)
def begin(self):
return _libhfst.HfstTwoLevelPaths_begin(self)
def end(self):
return _libhfst.HfstTwoLevelPaths_end(self)
def rbegin(self):
return _libhfst.HfstTwoLevelPaths_rbegin(self)
def rend(self):
return _libhfst.HfstTwoLevelPaths_rend(self)
def erase(self, *args):
return _libhfst.HfstTwoLevelPaths_erase(self, *args)
def find(self, x):
return _libhfst.HfstTwoLevelPaths_find(self, x)
def lower_bound(self, x):
return _libhfst.HfstTwoLevelPaths_lower_bound(self, x)
def upper_bound(self, x):
return _libhfst.HfstTwoLevelPaths_upper_bound(self, x)
def equal_range(self, x):
return _libhfst.HfstTwoLevelPaths_equal_range(self, x)
def insert(self, __x):
return _libhfst.HfstTwoLevelPaths_insert(self, __x)
__swig_destroy__ = _libhfst.delete_HfstTwoLevelPaths
__del__ = lambda self: None
HfstTwoLevelPaths_swigregister = _libhfst.HfstTwoLevelPaths_swigregister
HfstTwoLevelPaths_swigregister(HfstTwoLevelPaths)
class HfstTransducerPair(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTransducerPair, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTransducerPair, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstTransducerPair(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_setmethods__["first"] = _libhfst.HfstTransducerPair_first_set
__swig_getmethods__["first"] = _libhfst.HfstTransducerPair_first_get
if _newclass:
first = _swig_property(_libhfst.HfstTransducerPair_first_get, _libhfst.HfstTransducerPair_first_set)
__swig_setmethods__["second"] = _libhfst.HfstTransducerPair_second_set
__swig_getmethods__["second"] = _libhfst.HfstTransducerPair_second_get
if _newclass:
second = _swig_property(_libhfst.HfstTransducerPair_second_get, _libhfst.HfstTransducerPair_second_set)
def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
def __getitem__(self, index):
if not (index % 2):
return self.first
else:
return self.second
def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val
__swig_destroy__ = _libhfst.delete_HfstTransducerPair
__del__ = lambda self: None
HfstTransducerPair_swigregister = _libhfst.HfstTransducerPair_swigregister
HfstTransducerPair_swigregister(HfstTransducerPair)
class HfstTransducerPairVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTransducerPairVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTransducerPairVector, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstTransducerPairVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstTransducerPairVector___nonzero__(self)
def __bool__(self):
return _libhfst.HfstTransducerPairVector___bool__(self)
def __len__(self):
return _libhfst.HfstTransducerPairVector___len__(self)
def __getslice__(self, i, j):
return _libhfst.HfstTransducerPairVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.HfstTransducerPairVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.HfstTransducerPairVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.HfstTransducerPairVector___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.HfstTransducerPairVector___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.HfstTransducerPairVector___setitem__(self, *args)
def pop(self):
return _libhfst.HfstTransducerPairVector_pop(self)
def append(self, x):
return _libhfst.HfstTransducerPairVector_append(self, x)
def empty(self):
return _libhfst.HfstTransducerPairVector_empty(self)
def size(self):
return _libhfst.HfstTransducerPairVector_size(self)
def swap(self, v):
return _libhfst.HfstTransducerPairVector_swap(self, v)
def begin(self):
return _libhfst.HfstTransducerPairVector_begin(self)
def end(self):
return _libhfst.HfstTransducerPairVector_end(self)
def rbegin(self):
return _libhfst.HfstTransducerPairVector_rbegin(self)
def rend(self):
return _libhfst.HfstTransducerPairVector_rend(self)
def clear(self):
return _libhfst.HfstTransducerPairVector_clear(self)
def get_allocator(self):
return _libhfst.HfstTransducerPairVector_get_allocator(self)
def pop_back(self):
return _libhfst.HfstTransducerPairVector_pop_back(self)
def erase(self, *args):
return _libhfst.HfstTransducerPairVector_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_HfstTransducerPairVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.HfstTransducerPairVector_push_back(self, x)
def front(self):
return _libhfst.HfstTransducerPairVector_front(self)
def back(self):
return _libhfst.HfstTransducerPairVector_back(self)
def assign(self, n, x):
return _libhfst.HfstTransducerPairVector_assign(self, n, x)
def resize(self, *args):
return _libhfst.HfstTransducerPairVector_resize(self, *args)
def insert(self, *args):
return _libhfst.HfstTransducerPairVector_insert(self, *args)
def reserve(self, n):
return _libhfst.HfstTransducerPairVector_reserve(self, n)
def capacity(self):
return _libhfst.HfstTransducerPairVector_capacity(self)
__swig_destroy__ = _libhfst.delete_HfstTransducerPairVector
__del__ = lambda self: None
HfstTransducerPairVector_swigregister = _libhfst.HfstTransducerPairVector_swigregister
HfstTransducerPairVector_swigregister(HfstTransducerPairVector)
class HfstRuleVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstRuleVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstRuleVector, name)
__repr__ = _swig_repr
def iterator(self):
return _libhfst.HfstRuleVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _libhfst.HfstRuleVector___nonzero__(self)
def __bool__(self):
return _libhfst.HfstRuleVector___bool__(self)
def __len__(self):
return _libhfst.HfstRuleVector___len__(self)
def __getslice__(self, i, j):
return _libhfst.HfstRuleVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _libhfst.HfstRuleVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _libhfst.HfstRuleVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _libhfst.HfstRuleVector___delitem__(self, *args)
def __getitem__(self, *args):
return _libhfst.HfstRuleVector___getitem__(self, *args)
def __setitem__(self, *args):
return _libhfst.HfstRuleVector___setitem__(self, *args)
def pop(self):
return _libhfst.HfstRuleVector_pop(self)
def append(self, x):
return _libhfst.HfstRuleVector_append(self, x)
def empty(self):
return _libhfst.HfstRuleVector_empty(self)
def size(self):
return _libhfst.HfstRuleVector_size(self)
def swap(self, v):
return _libhfst.HfstRuleVector_swap(self, v)
def begin(self):
return _libhfst.HfstRuleVector_begin(self)
def end(self):
return _libhfst.HfstRuleVector_end(self)
def rbegin(self):
return _libhfst.HfstRuleVector_rbegin(self)
def rend(self):
return _libhfst.HfstRuleVector_rend(self)
def clear(self):
return _libhfst.HfstRuleVector_clear(self)
def get_allocator(self):
return _libhfst.HfstRuleVector_get_allocator(self)
def pop_back(self):
return _libhfst.HfstRuleVector_pop_back(self)
def erase(self, *args):
return _libhfst.HfstRuleVector_erase(self, *args)
def __init__(self, *args):
this = _libhfst.new_HfstRuleVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _libhfst.HfstRuleVector_push_back(self, x)
def front(self):
return _libhfst.HfstRuleVector_front(self)
def back(self):
return _libhfst.HfstRuleVector_back(self)
def assign(self, n, x):
return _libhfst.HfstRuleVector_assign(self, n, x)
def resize(self, *args):
return _libhfst.HfstRuleVector_resize(self, *args)
def insert(self, *args):
return _libhfst.HfstRuleVector_insert(self, *args)
def reserve(self, n):
return _libhfst.HfstRuleVector_reserve(self, n)
def capacity(self):
return _libhfst.HfstRuleVector_capacity(self)
__swig_destroy__ = _libhfst.delete_HfstRuleVector
__del__ = lambda self: None
HfstRuleVector_swigregister = _libhfst.HfstRuleVector_swigregister
HfstRuleVector_swigregister(HfstRuleVector)
class HfstException(Exception):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstException, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstException, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstException(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_HfstException
__del__ = lambda self: None
def what(self):
return _libhfst.HfstException_what(self)
HfstException_swigregister = _libhfst.HfstException_swigregister
HfstException_swigregister(HfstException)
class HfstTransducerTypeMismatchException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTransducerTypeMismatchException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, HfstTransducerTypeMismatchException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_HfstTransducerTypeMismatchException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_HfstTransducerTypeMismatchException
__del__ = lambda self: None
def what(self):
return _libhfst.HfstTransducerTypeMismatchException_what(self)
HfstTransducerTypeMismatchException_swigregister = _libhfst.HfstTransducerTypeMismatchException_swigregister
HfstTransducerTypeMismatchException_swigregister(HfstTransducerTypeMismatchException)
class ImplementationTypeNotAvailableException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ImplementationTypeNotAvailableException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ImplementationTypeNotAvailableException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4, type):
this = _libhfst.new_ImplementationTypeNotAvailableException(arg2, arg3, arg4, type)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_ImplementationTypeNotAvailableException
__del__ = lambda self: None
def what(self):
return _libhfst.ImplementationTypeNotAvailableException_what(self)
def get_type(self):
return _libhfst.ImplementationTypeNotAvailableException_get_type(self)
ImplementationTypeNotAvailableException_swigregister = _libhfst.ImplementationTypeNotAvailableException_swigregister
ImplementationTypeNotAvailableException_swigregister(ImplementationTypeNotAvailableException)
class FunctionNotImplementedException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, FunctionNotImplementedException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, FunctionNotImplementedException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_FunctionNotImplementedException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_FunctionNotImplementedException
__del__ = lambda self: None
def what(self):
return _libhfst.FunctionNotImplementedException_what(self)
FunctionNotImplementedException_swigregister = _libhfst.FunctionNotImplementedException_swigregister
FunctionNotImplementedException_swigregister(FunctionNotImplementedException)
class StreamNotReadableException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, StreamNotReadableException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, StreamNotReadableException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_StreamNotReadableException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_StreamNotReadableException
__del__ = lambda self: None
def what(self):
return _libhfst.StreamNotReadableException_what(self)
StreamNotReadableException_swigregister = _libhfst.StreamNotReadableException_swigregister
StreamNotReadableException_swigregister(StreamNotReadableException)
class StreamCannotBeWrittenException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, StreamCannotBeWrittenException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, StreamCannotBeWrittenException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_StreamCannotBeWrittenException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_StreamCannotBeWrittenException
__del__ = lambda self: None
def what(self):
return _libhfst.StreamCannotBeWrittenException_what(self)
StreamCannotBeWrittenException_swigregister = _libhfst.StreamCannotBeWrittenException_swigregister
StreamCannotBeWrittenException_swigregister(StreamCannotBeWrittenException)
class StreamIsClosedException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, StreamIsClosedException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, StreamIsClosedException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_StreamIsClosedException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_StreamIsClosedException
__del__ = lambda self: None
def what(self):
return _libhfst.StreamIsClosedException_what(self)
StreamIsClosedException_swigregister = _libhfst.StreamIsClosedException_swigregister
StreamIsClosedException_swigregister(StreamIsClosedException)
class EndOfStreamException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, EndOfStreamException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, EndOfStreamException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_EndOfStreamException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_EndOfStreamException
__del__ = lambda self: None
def what(self):
return _libhfst.EndOfStreamException_what(self)
EndOfStreamException_swigregister = _libhfst.EndOfStreamException_swigregister
EndOfStreamException_swigregister(EndOfStreamException)
class TransducerIsCyclicException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, TransducerIsCyclicException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, TransducerIsCyclicException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_TransducerIsCyclicException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_TransducerIsCyclicException
__del__ = lambda self: None
def what(self):
return _libhfst.TransducerIsCyclicException_what(self)
TransducerIsCyclicException_swigregister = _libhfst.TransducerIsCyclicException_swigregister
TransducerIsCyclicException_swigregister(TransducerIsCyclicException)
class NotTransducerStreamException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, NotTransducerStreamException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, NotTransducerStreamException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_NotTransducerStreamException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_NotTransducerStreamException
__del__ = lambda self: None
def what(self):
return _libhfst.NotTransducerStreamException_what(self)
NotTransducerStreamException_swigregister = _libhfst.NotTransducerStreamException_swigregister
NotTransducerStreamException_swigregister(NotTransducerStreamException)
class NotValidAttFormatException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, NotValidAttFormatException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, NotValidAttFormatException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_NotValidAttFormatException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_NotValidAttFormatException
__del__ = lambda self: None
def what(self):
return _libhfst.NotValidAttFormatException_what(self)
NotValidAttFormatException_swigregister = _libhfst.NotValidAttFormatException_swigregister
NotValidAttFormatException_swigregister(NotValidAttFormatException)
class NotValidPrologFormatException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, NotValidPrologFormatException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, NotValidPrologFormatException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_NotValidPrologFormatException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_NotValidPrologFormatException
__del__ = lambda self: None
def what(self):
return _libhfst.NotValidPrologFormatException_what(self)
NotValidPrologFormatException_swigregister = _libhfst.NotValidPrologFormatException_swigregister
NotValidPrologFormatException_swigregister(NotValidPrologFormatException)
class NotValidLexcFormatException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, NotValidLexcFormatException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, NotValidLexcFormatException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_NotValidLexcFormatException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_NotValidLexcFormatException
__del__ = lambda self: None
def what(self):
return _libhfst.NotValidLexcFormatException_what(self)
NotValidLexcFormatException_swigregister = _libhfst.NotValidLexcFormatException_swigregister
NotValidLexcFormatException_swigregister(NotValidLexcFormatException)
class StateIsNotFinalException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, StateIsNotFinalException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, StateIsNotFinalException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_StateIsNotFinalException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_StateIsNotFinalException
__del__ = lambda self: None
def what(self):
return _libhfst.StateIsNotFinalException_what(self)
StateIsNotFinalException_swigregister = _libhfst.StateIsNotFinalException_swigregister
StateIsNotFinalException_swigregister(StateIsNotFinalException)
class ContextTransducersAreNotAutomataException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ContextTransducersAreNotAutomataException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ContextTransducersAreNotAutomataException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_ContextTransducersAreNotAutomataException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_ContextTransducersAreNotAutomataException
__del__ = lambda self: None
def what(self):
return _libhfst.ContextTransducersAreNotAutomataException_what(self)
ContextTransducersAreNotAutomataException_swigregister = _libhfst.ContextTransducersAreNotAutomataException_swigregister
ContextTransducersAreNotAutomataException_swigregister(ContextTransducersAreNotAutomataException)
class TransducersAreNotAutomataException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, TransducersAreNotAutomataException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, TransducersAreNotAutomataException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_TransducersAreNotAutomataException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_TransducersAreNotAutomataException
__del__ = lambda self: None
def what(self):
return _libhfst.TransducersAreNotAutomataException_what(self)
TransducersAreNotAutomataException_swigregister = _libhfst.TransducersAreNotAutomataException_swigregister
TransducersAreNotAutomataException_swigregister(TransducersAreNotAutomataException)
class StateIndexOutOfBoundsException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, StateIndexOutOfBoundsException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, StateIndexOutOfBoundsException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_StateIndexOutOfBoundsException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_StateIndexOutOfBoundsException
__del__ = lambda self: None
def what(self):
return _libhfst.StateIndexOutOfBoundsException_what(self)
StateIndexOutOfBoundsException_swigregister = _libhfst.StateIndexOutOfBoundsException_swigregister
StateIndexOutOfBoundsException_swigregister(StateIndexOutOfBoundsException)
class TransducerHeaderException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, TransducerHeaderException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, TransducerHeaderException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_TransducerHeaderException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_TransducerHeaderException
__del__ = lambda self: None
def what(self):
return _libhfst.TransducerHeaderException_what(self)
TransducerHeaderException_swigregister = _libhfst.TransducerHeaderException_swigregister
TransducerHeaderException_swigregister(TransducerHeaderException)
class MissingOpenFstInputSymbolTableException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, MissingOpenFstInputSymbolTableException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, MissingOpenFstInputSymbolTableException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_MissingOpenFstInputSymbolTableException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_MissingOpenFstInputSymbolTableException
__del__ = lambda self: None
def what(self):
return _libhfst.MissingOpenFstInputSymbolTableException_what(self)
MissingOpenFstInputSymbolTableException_swigregister = _libhfst.MissingOpenFstInputSymbolTableException_swigregister
MissingOpenFstInputSymbolTableException_swigregister(MissingOpenFstInputSymbolTableException)
class TransducerTypeMismatchException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, TransducerTypeMismatchException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, TransducerTypeMismatchException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_TransducerTypeMismatchException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_TransducerTypeMismatchException
__del__ = lambda self: None
def what(self):
return _libhfst.TransducerTypeMismatchException_what(self)
TransducerTypeMismatchException_swigregister = _libhfst.TransducerTypeMismatchException_swigregister
TransducerTypeMismatchException_swigregister(TransducerTypeMismatchException)
class EmptySetOfContextsException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, EmptySetOfContextsException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, EmptySetOfContextsException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_EmptySetOfContextsException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_EmptySetOfContextsException
__del__ = lambda self: None
def what(self):
return _libhfst.EmptySetOfContextsException_what(self)
EmptySetOfContextsException_swigregister = _libhfst.EmptySetOfContextsException_swigregister
EmptySetOfContextsException_swigregister(EmptySetOfContextsException)
class SpecifiedTypeRequiredException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SpecifiedTypeRequiredException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SpecifiedTypeRequiredException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_SpecifiedTypeRequiredException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_SpecifiedTypeRequiredException
__del__ = lambda self: None
def what(self):
return _libhfst.SpecifiedTypeRequiredException_what(self)
SpecifiedTypeRequiredException_swigregister = _libhfst.SpecifiedTypeRequiredException_swigregister
SpecifiedTypeRequiredException_swigregister(SpecifiedTypeRequiredException)
class HfstFatalException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstFatalException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, HfstFatalException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_HfstFatalException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_HfstFatalException
__del__ = lambda self: None
def what(self):
return _libhfst.HfstFatalException_what(self)
HfstFatalException_swigregister = _libhfst.HfstFatalException_swigregister
HfstFatalException_swigregister(HfstFatalException)
class TransducerHasWrongTypeException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, TransducerHasWrongTypeException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, TransducerHasWrongTypeException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_TransducerHasWrongTypeException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_TransducerHasWrongTypeException
__del__ = lambda self: None
def what(self):
return _libhfst.TransducerHasWrongTypeException_what(self)
TransducerHasWrongTypeException_swigregister = _libhfst.TransducerHasWrongTypeException_swigregister
TransducerHasWrongTypeException_swigregister(TransducerHasWrongTypeException)
class IncorrectUtf8CodingException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, IncorrectUtf8CodingException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, IncorrectUtf8CodingException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_IncorrectUtf8CodingException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_IncorrectUtf8CodingException
__del__ = lambda self: None
def what(self):
return _libhfst.IncorrectUtf8CodingException_what(self)
IncorrectUtf8CodingException_swigregister = _libhfst.IncorrectUtf8CodingException_swigregister
IncorrectUtf8CodingException_swigregister(IncorrectUtf8CodingException)
class EmptyStringException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, EmptyStringException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, EmptyStringException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_EmptyStringException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_EmptyStringException
__del__ = lambda self: None
def what(self):
return _libhfst.EmptyStringException_what(self)
EmptyStringException_swigregister = _libhfst.EmptyStringException_swigregister
EmptyStringException_swigregister(EmptyStringException)
class SymbolNotFoundException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SymbolNotFoundException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SymbolNotFoundException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_SymbolNotFoundException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_SymbolNotFoundException
__del__ = lambda self: None
def what(self):
return _libhfst.SymbolNotFoundException_what(self)
SymbolNotFoundException_swigregister = _libhfst.SymbolNotFoundException_swigregister
SymbolNotFoundException_swigregister(SymbolNotFoundException)
class MetadataException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, MetadataException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, MetadataException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_MetadataException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_MetadataException
__del__ = lambda self: None
def what(self):
return _libhfst.MetadataException_what(self)
MetadataException_swigregister = _libhfst.MetadataException_swigregister
MetadataException_swigregister(MetadataException)
class FlagDiacriticsAreNotIdentitiesException(HfstException):
__swig_setmethods__ = {}
for _s in [HfstException]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, FlagDiacriticsAreNotIdentitiesException, name, value)
__swig_getmethods__ = {}
for _s in [HfstException]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, FlagDiacriticsAreNotIdentitiesException, name)
__repr__ = _swig_repr
def __init__(self, arg2, arg3, arg4):
this = _libhfst.new_FlagDiacriticsAreNotIdentitiesException(arg2, arg3, arg4)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_FlagDiacriticsAreNotIdentitiesException
__del__ = lambda self: None
def what(self):
return _libhfst.FlagDiacriticsAreNotIdentitiesException_what(self)
FlagDiacriticsAreNotIdentitiesException_swigregister = _libhfst.FlagDiacriticsAreNotIdentitiesException_swigregister
FlagDiacriticsAreNotIdentitiesException_swigregister(FlagDiacriticsAreNotIdentitiesException)
SFST_TYPE = _libhfst.SFST_TYPE
TROPICAL_OPENFST_TYPE = _libhfst.TROPICAL_OPENFST_TYPE
LOG_OPENFST_TYPE = _libhfst.LOG_OPENFST_TYPE
FOMA_TYPE = _libhfst.FOMA_TYPE
XFSM_TYPE = _libhfst.XFSM_TYPE
HFST_OL_TYPE = _libhfst.HFST_OL_TYPE
HFST_OLW_TYPE = _libhfst.HFST_OLW_TYPE
HFST2_TYPE = _libhfst.HFST2_TYPE
UNSPECIFIED_TYPE = _libhfst.UNSPECIFIED_TYPE
ERROR_TYPE = _libhfst.ERROR_TYPE
REPL_UP = _libhfst.REPL_UP
REPL_DOWN = _libhfst.REPL_DOWN
REPL_RIGHT = _libhfst.REPL_RIGHT
REPL_LEFT = _libhfst.REPL_LEFT
class Rule(_object):
"""
todo
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Rule, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Rule, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_Rule(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def get_mapping(self):
return _libhfst.Rule_get_mapping(self)
def get_context(self):
return _libhfst.Rule_get_context(self)
def get_replType(self):
return _libhfst.Rule_get_replType(self)
def encodeFlags(self):
return _libhfst.Rule_encodeFlags(self)
__swig_destroy__ = _libhfst.delete_Rule
__del__ = lambda self: None
Rule_swigregister = _libhfst.Rule_swigregister
Rule_swigregister(Rule)
def replace(*args):
"""
todo
"""
return _libhfst.replace(*args)
def xerox_replace_left(*args):
return _libhfst.xerox_replace_left(*args)
xerox_replace_left = _libhfst.xerox_replace_left
def replace_leftmost_longest_match(*args):
"""
todo
"""
return _libhfst.replace_leftmost_longest_match(*args)
def replace_rightmost_longest_match(*args):
"""
todo
"""
return _libhfst.replace_rightmost_longest_match(*args)
def replace_leftmost_shortest_match(*args):
"""
todo
"""
return _libhfst.replace_leftmost_shortest_match(*args)
def replace_rightmost_shortest_match(*args):
"""
todo
"""
return _libhfst.replace_rightmost_shortest_match(*args)
def replace_epenthesis(*args):
"""
todo
"""
return _libhfst.replace_epenthesis(*args)
def xerox_restriction(automata, context):
return _libhfst.xerox_restriction(automata, context)
xerox_restriction = _libhfst.xerox_restriction
def before(left, right):
"""
todo
"""
return _libhfst.before(left, right)
def after(left, right):
"""
todo
"""
return _libhfst.after(left, right)
def is_diacritic(symbol):
"""
Whether symbol *symbol* is a flag diacritic.
Flag diacritics are of the form
@[PNDRCU][.][A-Z]+([.][A-Z]+)?@
"""
return _libhfst.is_diacritic(symbol)
def compile_pmatch_expression(pmatch):
"""
Compile a pmatch expression into a tuple of transducers.
Parameters
----------
* `expr` :
A string defining how pmatch is done.
See also: hfst.compile_pmatch_file
"""
return _libhfst.compile_pmatch_expression(pmatch)
def _is_string(s):
if isinstance(s, str):
return True
else:
return False
def _is_string_pair(sp):
if not isinstance(sp, tuple):
return False
if len(sp) != 2:
return False
if not _is_string(sp[0]):
return False
if not _is_string(sp[1]):
return False
return True
def _is_string_vector(sv):
if not isinstance(sv, tuple):
return False
for s in sv:
if not _is_string(s):
return False
return True
def _is_string_pair_vector(spv):
if not isinstance(spv, tuple):
return False
for sp in spv:
if not _is_string_pair(sp):
return False
return True
def _two_level_paths_to_dict(tlps):
retval = {}
for tlp in tlps:
input = ""
output = ""
for sp in tlp[1]:
input += sp[0]
output += sp[1]
if input in retval:
retval[input].append((output, tlp[0]))
else:
retval[input] = [(output, tlp[0])]
return retval
def _one_level_paths_to_tuple(olps):
retval = []
for olp in olps:
path = ""
for s in olp[1]:
path += s
retval.append((path, olp[0]))
return tuple(retval)
class HfstTransducer(_object):
"""
A synchronous finite-state transducer.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTransducer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTransducer, name)
__repr__ = _swig_repr
def set_name(self, name):
"""
Rename the transducer *name*.
Parameters
----------
* `name` :
The name of the transducer.
See also: get_name
"""
return _libhfst.HfstTransducer_set_name(self, name)
def get_name(self):
"""
Get the name of the transducer.
See also: set_name
"""
return _libhfst.HfstTransducer_get_name(self)
def get_type(self):
"""
The implementation type of the transducer.
Returns
-------
hfst.ImplementationType
"""
return _libhfst.HfstTransducer_get_type(self)
def set_property(self, property, value):
"""
Set arbitrary string property *property* to *value*.
Parameters
----------
* `property` :
A string naming the property.
* `value` :
A string expressing the value of *property*.
set_property('name', 'name of the transducer') equals set_name('name of the
transducer').
note: While this function is capable of creating endless amounts of arbitrary
metadata, it is suggested that property names are drawn from central
repository, or prefixed with "x-". A property that does not follow this
convention may affect the behavior of transducer in future releases.
"""
return _libhfst.HfstTransducer_set_property(self, property, value)
def get_property(self, property):
"""
Get arbitrary string propert *property*.
Parameters
----------
* `property` :
The name of the property whose value is returned. get_property('name') works
like get_name().
"""
return _libhfst.HfstTransducer_get_property(self, property)
def get_properties(self):
"""
Get all properties from the transducer.
Returns
-------
A dictionary whose keys are properties and whose values are the values of those
properties.
"""
return _libhfst.HfstTransducer_get_properties(self)
def compare(self, arg2, harmonize=True):
"""
Whether this transducer and *another* are equivalent.
Parameters
----------
* `another` :
The compared transducer.
pre: *self* and *another* must have the same implementation type.
Two transducers are equivalent iff they accept the same input/output string
pairs with the same weights and the same alignments.
note: For weighted transducers, the function often returns false negatives due
to weight precision issues.
"""
return _libhfst.HfstTransducer_compare(self, arg2, harmonize)
def number_of_states(self):
"""
The number of states in the transducer.
"""
return _libhfst.HfstTransducer_number_of_states(self)
def number_of_arcs(self):
"""
The number of transitions in the transducer.
"""
return _libhfst.HfstTransducer_number_of_arcs(self)
def get_alphabet(self):
"""
Get the alphabet of the transducer.
The alphabet is defined as the set of symbols known to the transducer.
Returns
-------
A tuple of strings.
"""
return _libhfst.HfstTransducer_get_alphabet(self)
def is_cyclic(self):
"""
Whether the transducer is cyclic.
"""
return _libhfst.HfstTransducer_is_cyclic(self)
def is_automaton(self):
"""
Whether each transition in the transducer has equivalent input and output
symbols.
note: Transition with hfst.UNKNOWN on both sides IS NOT a transition with
equivalent input and output symbols.
note: Transition with hfst.IDENTITY on both sides IS a transition with
equivalent input and output symbols.
"""
return _libhfst.HfstTransducer_is_automaton(self)
def is_infinitely_ambiguous(self):
"""
Whether the transducer is infinitely ambiguous.
A transducer is infinitely ambiguous if there exists an input that will yield
infinitely many results, i.e. there are input epsilon loops that are traversed
with that input.
"""
return _libhfst.HfstTransducer_is_infinitely_ambiguous(self)
def is_lookup_infinitely_ambiguous(self, arg2):
"""
Whether lookup of path *input* will have infinite results.
Currently, this function will return whether the transducer is infinitely
ambiguous on any lookup path found in the transducer, i.e. the argument *input*
is ignored.
Todo
Do not ignore the argument *input*
"""
return _libhfst.HfstTransducer_is_lookup_infinitely_ambiguous(self, arg2)
def has_flag_diacritics(self):
"""
Whether the transducer has flag diacritics in its transitions.
"""
return _libhfst.HfstTransducer_has_flag_diacritics(self)
def insert_to_alphabet(self, arg2):
"""
Explicitly insert *symbol* to the alphabet of the transducer.
Parameters
----------
* `symbol` :
The symbol (string) to be inserted.
note: Usually this function is not needed since new symbols are added to the
alphabet by default.
"""
return _libhfst.HfstTransducer_insert_to_alphabet(self, arg2)
def remove_from_alphabet(self, arg2):
"""
Remove *symbol* from the alphabet of the transducer.
Parameters
----------
* `symbol` :
The symbol (string) to be removed.
pre: *symbol* does not occur in any transition of the transducer.
note: Use with care, removing a symbol that occurs in a transition of the
transducer can have unexpected results.
"""
return _libhfst.HfstTransducer_remove_from_alphabet(self, arg2)
def is_implementation_type_available(type):
"""
Whether HFST is linked to the transducer library needed by implementation type
*type*.
"""
return _libhfst.HfstTransducer_is_implementation_type_available(type)
is_implementation_type_available = staticmethod(is_implementation_type_available)
def longest_path_size(self, obey_flags=True):
"""
Get length of longest path of the transducer.
"""
return _libhfst.HfstTransducer_longest_path_size(self, obey_flags)
def concatenate(self, tr, harmonize=True):
"""
Concatenate this transducer with *another*.
"""
return _libhfst.HfstTransducer_concatenate(self, tr, harmonize)
def disjunct(self, tr, harmonize=True):
"""
Disjunct this transducer with *another*.
"""
return _libhfst.HfstTransducer_disjunct(self, tr, harmonize)
def subtract(self, tr, harmonize=True):
"""
Subtract transducer *another* from this transducer.
"""
return _libhfst.HfstTransducer_subtract(self, tr, harmonize)
def intersect(self, tr, harmonize=True):
"""
Intersect this transducer with *another*.
"""
return _libhfst.HfstTransducer_intersect(self, tr, harmonize)
def compose(self, tr, harmonize=True):
"""
Compose this transducer with *another*.
Parameters
----------
* `another` :
The second argument in the composition. Not modified.
"""
return _libhfst.HfstTransducer_compose(self, tr, harmonize)
def compose_intersect(self, v, invert=False, harmonize=True):
"""
Compose this transducer with the intersection of transducers in *v*.
If *invert* is true, then compose the intersection of the transducers in *v*
with this transducer.
The algorithm used by this function is faster than intersecting all transducers
one by one and then composing this transducer with the intersection.
pre: The transducers in *v* are deterministic and epsilon-free.
Parameters
----------
* `v` :
A tuple of transducers.
* `invert` :
Whether the intersection of the transducers in *v* is composed with this
transducer.
"""
return _libhfst.HfstTransducer_compose_intersect(self, v, invert, harmonize)
def priority_union(self, another):
"""
Make priority union of this transducer with *another*.
For the operation t1.priority_union(t2), the result is a union of t1 and t2,
except that whenever t1 and t2 have the same string on left side, the path in t2
overrides the path in t1.
Example
Transducer 1 (t1):
a : a
b : b
Transducer 2 (t2):
b : B
c : C
Result ( t1.priority_union(t2) ):
a : a
b : B
c : C For more information, read fsmbook.
"""
return _libhfst.HfstTransducer_priority_union(self, another)
def lenient_composition(self, another, harmonize=True):
"""
Perform a lenient composition on this transducer and *another*.
TODO: explain more.
"""
return _libhfst.HfstTransducer_lenient_composition(self, another, harmonize)
def cross_product(self, another, harmonize=True):
"""
Make cross product of this transducer with *another*.
It pairs every string of this with every string of *another*. If strings are not
the same length, epsilon padding will be added in the end of the shorter string.
pre: Both transducers must be automata, i.e. map strings onto themselves.
"""
return _libhfst.HfstTransducer_cross_product(self, another, harmonize)
def shuffle(self, another, harmonize=True):
"""
Shuffle this transducer with transducer *another*.
If transducer A accepts string 'foo' and transducer B string 'bar', the
transducer that results from shuffling A and B accepts all strings
[(f|b)(o|a)(o|r)].
pre: Both transducers must be automata, i.e. map strings onto themselves.
"""
return _libhfst.HfstTransducer_shuffle(self, another, harmonize)
def remove_epsilons(self):
"""
Remove all *epsilon:epsilon* transitions from the transducer so that the
resulting transducer is equivalent to the original one.
"""
return _libhfst.HfstTransducer_remove_epsilons(self)
def determinize(self):
"""
Determinize the transducer.
Determinizing a transducer yields an equivalent transducer that has no state
with two or more transitions whose input:output symbol pairs are the same.
"""
return _libhfst.HfstTransducer_determinize(self)
def minimize(self):
"""
Minimize the transducer.
Minimizing a transducer yields an equivalent transducer with the smallest number
of states.
Bug
OpenFst's minimization algorithm seems to add epsilon transitions to weighted
transducers?
"""
return _libhfst.HfstTransducer_minimize(self)
def prune(self):
"""
Make transducer coaccessible.
A transducer is coaccessible iff there is a path from every state to a final
state.
"""
return _libhfst.HfstTransducer_prune(self)
def eliminate_flags(self):
"""
Eliminate flag diacritics listed in *symbols* from the transducer.
Parameters
----------
* `symbols` :
The flags to be eliminated. TODO: explain more.
An equivalent transducer with no flags listed in *symbols*.
"""
return _libhfst.HfstTransducer_eliminate_flags(self)
def eliminate_flag(self, f):
"""
Eliminate flag diacritic *symbol* from the transducer.
Parameters
----------
* `symbol` :
The flag to be eliminated. TODO: explain more.
An equivalent transducer with no flags *symbol*.
"""
return _libhfst.HfstTransducer_eliminate_flag(self, f)
def n_best(self, n):
"""
Extract *n* best paths of the transducer.
In the case of a weighted transducer (hfst.ImplementationType.TROPICAL_OPENFST_TYPE or
hfst.ImplementationType.LOG_OPENFST_TYPE), best paths are defined as paths with the lowest
weight. In the case of an unweighted transducer (hfst.ImplementationType.SFST_TYPE or
hfst.ImplementationType.FOMA_TYPE), the function returns random paths.
This function is not implemented for hfst.ImplementationType.FOMA_TYPE or
hfst.ImplementationType.SFST_TYPE. If this function is called by an HfstTransducer of type
hfst.ImplementationType.FOMA_TYPE or hfst.ImplementationType.SFST_TYPE, it is converted to
hfst.ImplementationType.TROPICAL_OPENFST_TYPE, paths are extracted and it is converted back
to hfst.ImplementationType.FOMA_TYPE or hfst.ImplementationType.SFST_TYPE. If HFST is not linked to
OpenFst library, an hfst.exceptions.ImplementationTypeNotAvailableException is
thrown.
"""
return _libhfst.HfstTransducer_n_best(self, n)
def convert(self, impl):
"""
Convert the transducer into an equivalent transducer in format *type*.
If a weighted transducer is converted into an unweighted one, all weights are
lost. In the reverse case, all weights are initialized to the semiring's one.
A transducer of type hfst.ImplementationType.SFST_TYPE, hfst.ImplementationType.TROPICAL_OPENFST_TYPE,
hfst.ImplementationType.LOG_OPENFST_TYPE or hfst.ImplementationType.FOMA_TYPE can be converted into an
hfst.ImplementationType.HFST_OL_TYPE or hfst.ImplementationType.HFST_OLW_TYPE transducer, but an
hfst.ImplementationType.HFST_OL_TYPE or hfst.ImplementationType.HFST_OLW_TYPE transducer cannot be
converted to any other type.
note: For conversion between HfstBasicTransducer and HfstTransducer, see
hfst.HfstTransducer.__init__ and hfst.HfstBasicTransducer.__init__
"""
return _libhfst.HfstTransducer_convert(self, impl)
def repeat_star(self):
"""
A concatenation of N transducers where N is any number from zero to infinity.
"""
return _libhfst.HfstTransducer_repeat_star(self)
def repeat_plus(self):
"""
A concatenation of N transducers where N is any number from one to infinity.
"""
return _libhfst.HfstTransducer_repeat_plus(self)
def repeat_n(self, n):
"""
A concatenation of *n* transducers.
"""
return _libhfst.HfstTransducer_repeat_n(self, n)
def repeat_n_to_k(self, n, k):
"""
A concatenation of N transducers where N is any number from *n* to *k*,
inclusive.
"""
return _libhfst.HfstTransducer_repeat_n_to_k(self, n, k)
def repeat_n_minus(self, n):
"""
A concatenation of N transducers where N is any number from zero to *n*,
inclusive.
"""
return _libhfst.HfstTransducer_repeat_n_minus(self, n)
def repeat_n_plus(self, n):
"""
A concatenation of N transducers where N is any number from *n* to infinity,
inclusive.
"""
return _libhfst.HfstTransducer_repeat_n_plus(self, n)
def invert(self):
"""
Swap the input and output symbols of each transition in the transducer.
"""
return _libhfst.HfstTransducer_invert(self)
def reverse(self):
"""
Reverse the transducer.
A reverted transducer accepts the string 'n(0) n(1) ... n(N)' iff the original
transducer accepts the string 'n(N) n(N-1) ... n(0)'
"""
return _libhfst.HfstTransducer_reverse(self)
def input_project(self):
"""
Extract the input language of the transducer.
All transition symbol pairs *isymbol:osymbol* are changed to *isymbol:isymbol*.
"""
return _libhfst.HfstTransducer_input_project(self)
def output_project(self):
"""
Extract the output language of the transducer.
All transition symbol pairs *isymbol:osymbol* are changed to *osymbol:osymbol*.
"""
return _libhfst.HfstTransducer_output_project(self)
def optionalize(self):
"""
Disjunct the transducer with an epsilon transducer.
"""
return _libhfst.HfstTransducer_optionalize(self)
def insert_freely(self, *args):
"""
Freely insert a transition or a transducer into the transducer.
Parameters
----------
* `ins` :
The transition or transducer to be inserted.
If *ins* is a transition, i.e. a 2-tuple of strings: A transition is added to
each state in this transducer. The transition leads from that state to itself
with input and output symbols defined by *ins*. The weight of the transition is
zero.
If *ins* is an hfst.HfstTransducer: A copy of *ins* is attached with epsilon
transitions to each state of this transducer. After the operation, for each
state S in this transducer, there is an epsilon transition that leads from state
S to the initial state of *ins*, and for each final state of *ins*, there is an
epsilon transition that leads from that final state to state S in this
transducer. The weights of the final states in *ins* are copied to the epsilon
transitions leading to state S.
"""
return _libhfst.HfstTransducer_insert_freely(self, *args)
def _substitute_symbol(self, old_symbol, new_symbol, input_side=True, output_side=True):
return _libhfst.HfstTransducer__substitute_symbol(self, old_symbol, new_symbol, input_side, output_side)
def _substitute_symbol_pair(self, old_symbol_pair, new_symbol_pair):
return _libhfst.HfstTransducer__substitute_symbol_pair(self, old_symbol_pair, new_symbol_pair)
def _substitute_symbol_pair_with_set(self, old_symbol_pair, new_symbol_pair_set):
return _libhfst.HfstTransducer__substitute_symbol_pair_with_set(self, old_symbol_pair, new_symbol_pair_set)
def _substitute_symbol_pair_with_transducer(self, symbol_pair, transducer, harmonize=True):
return _libhfst.HfstTransducer__substitute_symbol_pair_with_transducer(self, symbol_pair, transducer, harmonize)
def _substitute_symbols(self, substitutions):
return _libhfst.HfstTransducer__substitute_symbols(self, substitutions)
def _substitute_symbol_pairs(self, substitutions):
return _libhfst.HfstTransducer__substitute_symbol_pairs(self, substitutions)
def set_final_weights(self, weight, increment=False):
"""
Set the weights of all final states to *weight*.
If the HfstTransducer is of unweighted type (hfst.ImplementationType.SFST_TYPE or
hfst.ImplementationType.FOMA_TYPE), nothing is done.
"""
return _libhfst.HfstTransducer_set_final_weights(self, weight, increment)
def push_weights_to_start(self):
"""
Push weights towards initial state.
If the HfstTransducer is of unweighted type (hfst.ImplementationType.SFST_TYPE or
hfst.ImplementationType.FOMA_TYPE), nothing is done.
An example:
>>> import hfst
>>> tr = hfst.regex('[a::1 a:b::0.3 (b::0)]::0.7;')
>>> tr.push_weights_to_start()
>>> print(tr)
0 1 a a 2.000000
1 2 a b 0.000000
2 3 b b 0.000000
2 0.000000
3 0.000000
See also: hfst.HfstTransducer.push_weights_to_end
"""
return _libhfst.HfstTransducer_push_weights_to_start(self)
def push_weights_to_end(self):
"""
Push weights towards final state(s).
If the HfstTransducer is of unweighted type (hfst.ImplementationType.SFST_TYPE or
hfst.ImplementationType.FOMA_TYPE), nothing is done.
An example:
>>> import hfst
>>> tr = hfst.regex('[a::1 a:b::0.3 (b::0)]::0.7;')
>>> tr.push_weights_to_end()
>>> print(tr)
0 1 a a 0.000000
1 2 a b 0.000000
2 3 b b 0.000000
2 2.000000
3 2.000000
See also: hfst.HfstTransducer.push_weights_to_start
"""
return _libhfst.HfstTransducer_push_weights_to_end(self)
def minus(self, t, harmonize=True):
"""
Alias for subtract.
See also: hfst.HfstTransducer.subtract
"""
return _libhfst.HfstTransducer_minus(self, t, harmonize)
def conjunct(self, t, harmonize=True):
"""
Alias for intersect.
See also: hfst.HfstTransducer.intersect
"""
return _libhfst.HfstTransducer_conjunct(self, t, harmonize)
def lookup_optimize(self):
"""
Optimize the transducer for lookup.
This effectively converts the transducer into hfst.ImplementationType.HFST_OL_TYPE.
"""
return _libhfst.HfstTransducer_lookup_optimize(self)
def remove_optimization(self):
"""
Remove lookup optimization.
This effectively converts transducer (back) into default fst type.
"""
return _libhfst.HfstTransducer_remove_optimization(self)
def __init__(self, *args):
this = _libhfst.new_HfstTransducer(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_HfstTransducer
__del__ = lambda self: None
def __str__(self):
"""
An AT&T representation of the transducer.
Defined for print command. An example:
>>> print(hfst.regex('[foo:bar::2]+'))
0 1 foo bar 2.000000
1 1 foo bar 2.000000
1 0.000000 Todo
Works only for small transducers.
"""
return _libhfst.HfstTransducer___str__(self)
def write(self, os):
"""
Write the transducer in binary format to *ostr*.
Parameters
----------
* `ostr` :
A hfst.HfstOutputStream where the transducer is written.
"""
return _libhfst.HfstTransducer_write(self, os)
def _extract_shortest_paths(self):
return _libhfst.HfstTransducer__extract_shortest_paths(self)
def _extract_longest_paths(self, obey_flags):
return _libhfst.HfstTransducer__extract_longest_paths(self, obey_flags)
def _extract_paths(self, max_num=-1, cycles=-1):
return _libhfst.HfstTransducer__extract_paths(self, max_num, cycles)
def _extract_paths_fd(self, max_num=-1, cycles=-1, filter_fd=True):
return _libhfst.HfstTransducer__extract_paths_fd(self, max_num, cycles, filter_fd)
def _extract_random_paths(self, max_num):
return _libhfst.HfstTransducer__extract_random_paths(self, max_num)
def _extract_random_paths_fd(self, max_num, filter_fd):
return _libhfst.HfstTransducer__extract_random_paths_fd(self, max_num, filter_fd)
def _lookup_vector(self, s, limit=-1, time_cutoff=0.0):
return _libhfst.HfstTransducer__lookup_vector(self, s, limit, time_cutoff)
def _lookup_fd_vector(self, s, limit=-1, time_cutoff=0.0):
return _libhfst.HfstTransducer__lookup_fd_vector(self, s, limit, time_cutoff)
def _lookup_fd_string(self, s, limit=-1, time_cutoff=0.0):
return _libhfst.HfstTransducer__lookup_fd_string(self, s, limit, time_cutoff)
def _lookup_string(self, s, limit=-1, time_cutoff=0.0):
return _libhfst.HfstTransducer__lookup_string(self, s, limit, time_cutoff)
def copy(self):
"""
Return a deep copy of the transducer.
"""
return HfstTransducer(self)
def write_to_file(self, filename_):
"""
Write the transducer in binary format to file *filename_*.
"""
ostr = HfstOutputStream(filename=filename_, type=self.get_type(), hfst_format=True)
ostr.write(self)
ostr.close()
def read_from_file(filename_):
"""
Read a binary transducer from file *filename_*.
"""
istr = HfstInputStream(filename_)
tr = istr.read()
istr.close()
return tr
def write_prolog(self, f, write_weights=True):
"""
Write the transducer in prolog format with name *name* to file *f*,
*write_weights* defined whether weights are written.
Parameters
----------
* `f` :
A python file where the transducer is written.
* `write_weights` :
Whether weights are written.
"""
fsm = HfstBasicTransducer(self)
fsm.name = self.get_name()
prologstr = fsm.get_prolog_string(write_weights)
f.write(prologstr)
def write_xfst(self, f, write_weights=True):
"""
Write the transducer in xfst format to file *f*, *write_weights* defined whether
weights are written.
Parameters
----------
* `f` :
A python file where transducer is written.
* `write_weights` :
Whether weights are written.
"""
fsm = HfstBasicTransducer(self)
fsm.name = self.get_name()
xfststr = fsm.get_xfst_string(write_weights)
f.write(xfst)
def write_att(self, f, write_weights=True):
"""
Write the transducer in AT&T format to file *f*, *write_weights* defined whether
weights are written.
Parameters
----------
* `f` :
A python file where transducer is written.
* `write_weights` :
Whether weights are written.
"""
fsm = HfstBasicTransducer(self)
fsm.name = self.get_name()
attstr = fsm.get_att_string(write_weights)
f.write(attstr)
def lookup(self, input, **kvargs):
"""
Lookup string *input*.
Parameters
----------
* `input` :
The input. A string or a pre-tokenized tuple of symbols (i.e. a tuple of strings).
* `kvargs` :
Possible parameters and their default values are: obey_flags=True,
max_number=-1, time_cutoff=0.0, output='tuple'
* `obey_flags` :
Whether flag diacritics are obeyed. Always True for HFST_OL(W)_TYPE transducers.
* `max_number` :
Maximum number of results returned, defaults to -1, i.e. infinity.
* `time_cutoff` :
How long the function can search for results before returning, expressed in
seconds. Defaults to 0.0, i.e. infinitely. Always 0.0 for transducers that are
not of HFST_OL(W)_TYPE.
* `output` :
Possible values are 'tuple', 'text' and 'raw', 'tuple' being the default.
Note: This function has an efficient implementation only for optimized lookup format
(hfst.ImplementationType.HFST_OL_TYPE or hfst.ImplementationType.HFST_OLW_TYPE). Other formats perform the
lookup via composition. Consider converting the transducer to optimized lookup format
or to a HfstBasicTransducer. Conversion to HFST_OL(W)_TYPE might take a while but the
lookup is fast. Conversion to HfstBasicTransducer is quick but lookup is slower.
"""
obey_flags=True
max_number=-1
time_cutoff=0.0
output='tuple' # 'tuple' (default), 'text', 'raw'
for k,v in kvargs.items():
if k == 'obey_flags':
if v == 'True':
pass
elif v == 'False':
obey_flags=False
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'True' and 'False'.")
elif k == 'output':
if v == 'text':
output='text'
elif v == 'raw':
output='raw'
elif v == 'tuple':
output='tuple'
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'tuple' (default), 'text', 'raw'.")
elif k == 'max_number' :
max_number=v
elif k == 'time_cutoff' :
time_cutoff=v
else:
print('Warning: ignoring unknown argument %s.' % (k))
retval=0
if isinstance(input, tuple):
if obey_flags:
retval=self._lookup_fd_vector(input, max_number, time_cutoff)
else:
retval=self._lookup_vector(input, max_number, time_cutoff)
elif isinstance(input, str):
if obey_flags:
retval=self._lookup_fd_string(input, max_number, time_cutoff)
else:
retval=self._lookup_string(input, max_number, time_cutoff)
else:
try:
if obey_flags:
retval=self._lookup_fd_string(str(input), max_number, time_cutoff)
else:
retval=self._lookup_string(str(input), max_number, time_cutoff)
except:
raise RuntimeError('Input argument must be string or tuple.')
if output == 'text':
return one_level_paths_to_string(retval)
elif output == 'tuple':
return _one_level_paths_to_tuple(retval)
else:
return retval
def extract_longest_paths(self, **kvargs):
"""
Extract longest paths of the transducer.
Parameters
----------
* `kvargs` :
Possible parameters and their default values are: obey_flags=True,
output='dict'
* `obey_flags` :
Whether flag diacritics are obeyed. The default is True.
* `output` :
Possible values are 'dict', 'text' and 'raw', 'dict' being the default.
"""
obey_flags=True
output='dict' # 'dict' (default), 'text', 'raw'
for k,v in kvargs.items():
if k == 'obey_flags':
if v == 'True':
pass
elif v == 'False':
obey_flags=False
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'True' and 'False'.")
elif k == 'output':
if v == 'text':
output == 'text'
elif v == 'raw':
output='raw'
elif v == 'dict':
output='dict'
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'dict' (default), 'text', 'raw'.")
else:
print('Warning: ignoring unknown argument %s.' % (k))
retval = self._extract_longest_paths(obey_flags)
if output == 'text':
return two_level_paths_to_string(retval)
elif output == 'dict':
return _two_level_paths_to_dict(retval)
else:
return retval
def extract_shortest_paths(self, **kvargs):
"""
Extract shortest paths of the transducer.
Parameters
----------
* `kvargs` :
Possible parameters and their default values are: obey_flags=True.
* `output` :
Possible values are 'dict', 'text' and 'raw', 'dict' being the default.
"""
output='dict' # 'dict' (default), 'text', 'raw'
for k,v in kvargs.items():
if k == 'output':
if v == 'text':
output == 'text'
elif v == 'raw':
output='raw'
elif v == 'dict':
output='dict'
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'dict' (default), 'text', 'raw'.")
else:
print('Warning: ignoring unknown argument %s.' % (k))
retval = self._extract_shortest_paths()
if output == 'text':
return two_level_paths_to_string(retval)
elif output == 'dict':
return _two_level_paths_to_dict(retval)
else:
return retval
def extract_paths(self, **kvargs):
"""
Extract paths that are recognized by the transducer.
Parameters
----------
* `kvargs` :
Arguments recognized are filter_flags, max_cycles, max_number, obey_flags,
output, random.
* `filter_flags` :
Whether flags diacritics are filtered out from the result (default True).
* `max_cycles` :
Indicates how many times a cycle will be followed, with negative numbers
indicating unlimited (default -1 i.e. unlimited).
* `max_number` :
The total number of resulting strings is capped at this value, with 0 or
negative indicating unlimited (default -1 i.e. unlimited).
* `obey_flags` :
Whether flag diacritics are validated (default True).
* `output` :
Output format. Values recognized: 'text' (as a string, separated by
newlines), 'raw' (a dictionary that maps each input string into a list of
tuples of an output string and a weight), 'dict' (a dictionary that maps
each input string into a tuple of tuples of an output string and a weight,
the default).
* `random` :
Whether result strings are fetched randomly (default False).
Returns
-------
The extracted strings. *output* controls how they are represented.
pre: The transducer must be acyclic, if both *max_number* and *max_cycles* have
unlimited values. Else a hfst.exceptions.TransducerIsCyclicException will be
thrown.
An example:
>>> tr = hfst.regex('a:b+ (a:c+)')
>>> print(tr)
0 1 a b 0.000000
1 1 a b 0.000000
1 2 a c 0.000000
1 0.000000
2 2 a c 0.000000
2 0.000000
>>> print(tr.extract_paths(max_cycles=1, output='text'))
a:b 0
aa:bb 0
aaa:bbc 0
aaaa:bbcc 0
aa:bc 0
aaa:bcc 0
>>> print(tr.extract_paths(max_number=4, output='text'))
a:b 0
aa:bc 0
aaa:bcc 0
aaaa:bccc 0
>>> print(tr.extract_paths(max_cycles=1, max_number=4, output='text'))
a:b 0
aa:bb 0
aa:bc 0
aaa:bcc 0
Exceptions
----------
* `TransducerIsCyclicException` :
See also: hfst.HfstTransducer.n_best
"""
obey_flags=True
filter_flags=True
max_cycles=-1
max_number=-1
random=False
output='dict' # 'dict' (default), 'text', 'raw'
for k,v in kvargs.items():
if k == 'obey_flags' :
if v == 'True':
pass
elif v == 'False':
obey_flags=False
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'True' and 'False'.")
elif k == 'filter_flags' :
if v == 'True':
pass
elif v == 'False':
filter_flags=False
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'True' and 'False'.")
elif k == 'max_cycles' :
max_cycles=v
elif k == 'max_number' :
max_number=v
elif k == 'random' :
if v == 'False':
pass
elif v == 'True':
random=True
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'True' and 'False'.")
elif k == 'output':
if v == 'text':
output = 'text'
elif v == 'raw':
output='raw'
elif v == 'dict':
output='dict'
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'dict' (default), 'text', 'raw'.")
else:
print('Warning: ignoring unknown argument %s.' % (k))
retval=0
if obey_flags :
if random :
retval=self._extract_random_paths_fd(max_number, filter_flags)
else :
retval=self._extract_paths_fd(max_number, max_cycles)
else :
if random :
retval=self._extract_random_paths(max_number)
else :
retval=self._extract_paths(max_number, max_cycles)
if output == 'text':
return two_level_paths_to_string(retval)
elif output == 'dict':
return _two_level_paths_to_dict(retval)
else:
return retval
def substitute(self, s, S=None, **kvargs):
"""
Substitute symbols or transitions in the transducer.
Parameters
----------
* `s` :
The symbol or transition to be substituted. Can also be a dictionary of
substitutions, if S == None.
* `S` :
The symbol, transition, a tuple of transitions or a transducer
(hfst.HfstTransducer) that substitutes *s*.
* `kvargs` :
Arguments recognized are 'input' and 'output', their values can be False or
True, True being the default. These arguments are valid only if *s* and *S*
are strings, else they are ignored.
* `input` :
Whether substitution is performed on input side, defaults to True. Valid
only if *s* and *S* are strings.
* `output` :
Whether substitution is performed on output side, defaults to True. Valid
only if *s* and \\ S are strings.
For more information, see hfst.HfstBasicTransducer.substitute. The function
works similarly, with the exception of argument *S*, which must be
hfst.HfstTransducer instead of hfst.HfstBasicTransducer.
See also: hfst.HfstBasicTransducer.substitute
"""
if S == None:
if not isinstance(s, dict):
raise RuntimeError('Sole input argument must be a dictionary.')
subst_type=""
for k, v in s.items():
if _is_string(k):
if subst_type == "":
subst_type="string"
elif subst_type == "string pair":
raise RuntimeError('')
if not _is_string(v):
raise RuntimeError('')
elif _is_string_pair(k):
if subst_type == "":
subst_type="string pair"
elif subst_type == "string":
raise RuntimeError('')
if not _is_string_pair(v):
raise RuntimeError('')
else:
raise RuntimeError('')
if subst_type == "string":
return self._substitute_symbols(s)
else:
return self._substitute_symbol_pairs(s)
if _is_string(s):
if _is_string(S):
input=True
output=True
for k,v in kvargs.items():
if k == 'input':
if v == False:
input=False
elif k == 'output':
if v == False:
output=False
else:
raise RuntimeError('Free argument not recognized.')
return self._substitute_symbol(s, S, input, output)
else:
raise RuntimeError('...')
elif _is_string_pair(s):
if _is_string_pair(S):
return self._substitute_symbol_pair(s, S)
elif _is_string_pair_vector(S):
return self._substitute_symbol_pair_with_set(s, S)
elif isinstance(S, HfstTransducer):
return self._substitute_symbol_pair_with_transducer(s, S, True)
else:
raise RuntimeError('...')
else:
raise RuntimeError('...')
HfstTransducer_swigregister = _libhfst.HfstTransducer_swigregister
HfstTransducer_swigregister(HfstTransducer)
def HfstTransducer_is_implementation_type_available(type):
"""
Whether HFST is linked to the transducer library needed by implementation type
*type*.
"""
return _libhfst.HfstTransducer_is_implementation_type_available(type)
def create_hfst_output_stream(filename, type, hfst_format):
return _libhfst.create_hfst_output_stream(filename, type, hfst_format)
create_hfst_output_stream = _libhfst.create_hfst_output_stream
class HfstOutputStream(_object):
"""
A stream for writing binary transducers.
An example:
res = ['foo:bar','0','0 - 0','"?":?','a* b+']
ostr = hfst.HfstOutputStream(filename='testfile1.hfst')
for re in res:
ostr.write(hfst.regex(re))
ostr.flush()
ostr.close()
For more information on HFST transducer structure, see this page.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstOutputStream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstOutputStream, name)
__repr__ = _swig_repr
__swig_destroy__ = _libhfst.delete_HfstOutputStream
__del__ = lambda self: None
def flush(self):
"""
Flush the stream.
"""
return _libhfst.HfstOutputStream_flush(self)
def close(self):
"""
Close the stream.
If the stream points to standard output, nothing is done.
"""
return _libhfst.HfstOutputStream_close(self)
def write(self, transducer):
"""
Write the transducer *transducer* in binary format to the stream.
All transducers must have the same type as the stream, else a
TransducerTypeMismatchException is thrown.
Exceptions
----------
* `hfst.exceptions.TransducerTypeMismatchException` :
"""
return _libhfst.HfstOutputStream_write(self, transducer)
def __init__(self):
this = _libhfst.new_HfstOutputStream()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def __init__(self, **kvargs):
"""
Open a stream for writing binary transducers. Note: hfst.HfstTransducer.write_to_file
is probably the easiest way to write a single binary transducer to a file.
Parameters
----------
* `kvargs` :
Arguments recognized are filename, hfst_format, type.
* `filename` :
The name of the file where transducers are written. If the file exists, it
is overwritten. If *filename* is not given, transducers are written to
standard output.
* `hfst_format` :
Whether transducers are written in hfst format (default is True) or as such
in their backend format.
* `type` :
The type of the transducers that will be written to the stream. Default is
hfst.get_default_fst_type().
Examples:
# a stream for writing default type transducers in hfst format to standard output
ostr = hfst.HfstOutputStream()
transducer = hfst.regex('foo:bar::0.5')
ostr.write(transducer)
ostr.flush()
# a stream for writing native sfst type transducers to a file
ostr = hfst.HfstOutputStream(filename='transducer.sfst', hfst_format=False, type=hfst.ImplementationType.SFST_TYPE)
transducer1 = hfst.regex('foo:bar')
transducer1.convert(hfst.ImplementationType.SFST_TYPE) # if not set as the default type
transducer2 = hfst.regex('bar:baz')
transducer2.convert(hfst.ImplementationType.SFST_TYPE) # if not set as the default type
ostr.write(transducer1)
ostr.write(transducer2)
ostr.flush()
ostr.close()
"""
filename = ""
hfst_format = True
type = _libhfst.get_default_fst_type()
for k,v in kvargs.items():
if k == 'filename':
filename = v
if k == 'hfst_format':
hfst_format = v
if k == 'type':
type = v
if filename == "":
self.this = _libhfst.create_hfst_output_stream("", type, hfst_format)
else:
self.this = _libhfst.create_hfst_output_stream(filename, type, hfst_format)
HfstOutputStream_swigregister = _libhfst.HfstOutputStream_swigregister
HfstOutputStream_swigregister(HfstOutputStream)
class HfstInputStream(_object):
"""
A stream for reading HFST binary transducers.
An example:
istr = hfst.HfstInputStream('testfile1.hfst')
transducers = []
while not (istr.is_eof()):
transducers.append(istr.read())
istr.close()
print("Read %i transducers in total." % len(transducers))
For documentation on the HFST binary transducer format, see here.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstInputStream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstInputStream, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstInputStream(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_HfstInputStream
__del__ = lambda self: None
def close(self):
"""
Close the stream.
If the stream points to standard input, nothing is done.
"""
return _libhfst.HfstInputStream_close(self)
def is_eof(self):
"""
Whether the stream is at end.
"""
return _libhfst.HfstInputStream_is_eof(self)
def is_bad(self):
"""
Whether badbit is set.
"""
return _libhfst.HfstInputStream_is_bad(self)
def is_good(self):
"""
Whether the state of the stream is good for input operations.
"""
return _libhfst.HfstInputStream_is_good(self)
def get_type(self):
"""
The type of the first transducer in the stream.
By default, all transducers in a stream have the same type, else a
TransducerTypeMismatchException is thrown when reading the first transducer that
has a different type than the previous ones.
"""
return _libhfst.HfstInputStream_get_type(self)
def read(self):
"""
Return next transducer.
Exceptions
----------
* `EndOfStreamException` :
"""
return _libhfst.HfstInputStream_read(self)
def __iter__(self):
"""
Return *self*. Needed for 'for ... in' statement.
"""
return self
def next(self):
"""
Read next transducer from stream and return it. Needed for 'for ... in' statement.
"""
if self.is_eof():
raise StopIteration
else:
return self.read();
def __next__(self):
"""
Read next transducer from stream and return it. Needed for 'for ... in' statement.
"""
return self.next()
HfstInputStream_swigregister = _libhfst.HfstInputStream_swigregister
HfstInputStream_swigregister(HfstInputStream)
class HfstTokenizer(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstTokenizer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstTokenizer, name)
__repr__ = _swig_repr
def __init__(self):
this = _libhfst.new_HfstTokenizer()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def add_skip_symbol(self, symbol):
return _libhfst.HfstTokenizer_add_skip_symbol(self, symbol)
def add_multichar_symbol(self, symbol):
return _libhfst.HfstTokenizer_add_multichar_symbol(self, symbol)
def tokenize_one_level(self, input_string):
return _libhfst.HfstTokenizer_tokenize_one_level(self, input_string)
if _newclass:
tokenize_space_separated = staticmethod(_libhfst.HfstTokenizer_tokenize_space_separated)
else:
tokenize_space_separated = _libhfst.HfstTokenizer_tokenize_space_separated
def tokenize(self, *args):
return _libhfst.HfstTokenizer_tokenize(self, *args)
if _newclass:
check_utf8_correctness = staticmethod(_libhfst.HfstTokenizer_check_utf8_correctness)
else:
check_utf8_correctness = _libhfst.HfstTokenizer_check_utf8_correctness
__swig_destroy__ = _libhfst.delete_HfstTokenizer
__del__ = lambda self: None
HfstTokenizer_swigregister = _libhfst.HfstTokenizer_swigregister
HfstTokenizer_swigregister(HfstTokenizer)
def HfstTokenizer_tokenize_space_separated(str):
return _libhfst.HfstTokenizer_tokenize_space_separated(str)
HfstTokenizer_tokenize_space_separated = _libhfst.HfstTokenizer_tokenize_space_separated
def HfstTokenizer_check_utf8_correctness(input_string):
return _libhfst.HfstTokenizer_check_utf8_correctness(input_string)
HfstTokenizer_check_utf8_correctness = _libhfst.HfstTokenizer_check_utf8_correctness
class HfstBasicTransducer(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstBasicTransducer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstBasicTransducer, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstBasicTransducer(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_setmethods__["name"] = _libhfst.HfstBasicTransducer_name_set
__swig_getmethods__["name"] = _libhfst.HfstBasicTransducer_name_get
if _newclass:
name = _swig_property(_libhfst.HfstBasicTransducer_name_get, _libhfst.HfstBasicTransducer_name_set)
def add_symbol_to_alphabet(self, symbol):
return _libhfst.HfstBasicTransducer_add_symbol_to_alphabet(self, symbol)
def remove_symbol_from_alphabet(self, symbol):
return _libhfst.HfstBasicTransducer_remove_symbol_from_alphabet(self, symbol)
def remove_symbols_from_alphabet(self, symbols):
return _libhfst.HfstBasicTransducer_remove_symbols_from_alphabet(self, symbols)
def add_symbols_to_alphabet(self, symbols):
return _libhfst.HfstBasicTransducer_add_symbols_to_alphabet(self, symbols)
def symbols_used(self):
return _libhfst.HfstBasicTransducer_symbols_used(self)
def prune_alphabet(self, force=True):
return _libhfst.HfstBasicTransducer_prune_alphabet(self, force)
def get_alphabet(self):
return _libhfst.HfstBasicTransducer_get_alphabet(self)
def get_transition_pairs(self):
return _libhfst.HfstBasicTransducer_get_transition_pairs(self)
def add_state(self, *args):
return _libhfst.HfstBasicTransducer_add_state(self, *args)
def get_max_state(self):
return _libhfst.HfstBasicTransducer_get_max_state(self)
def states(self):
return _libhfst.HfstBasicTransducer_states(self)
def remove_transition(self, s, transition, remove_symbols_from_alphabet=False):
return _libhfst.HfstBasicTransducer_remove_transition(self, s, transition, remove_symbols_from_alphabet)
def is_final_state(self, s):
return _libhfst.HfstBasicTransducer_is_final_state(self, s)
def get_final_weight(self, s):
return _libhfst.HfstBasicTransducer_get_final_weight(self, s)
def set_final_weight(self, s, weight):
return _libhfst.HfstBasicTransducer_set_final_weight(self, s, weight)
def remove_final_weight(self, s):
return _libhfst.HfstBasicTransducer_remove_final_weight(self, s)
def _transitions(self, s):
return _libhfst.HfstBasicTransducer__transitions(self, s)
def is_infinitely_ambiguous(self):
return _libhfst.HfstBasicTransducer_is_infinitely_ambiguous(self)
def is_lookup_infinitely_ambiguous(self, s):
return _libhfst.HfstBasicTransducer_is_lookup_infinitely_ambiguous(self, s)
def longest_path_size(self):
return _libhfst.HfstBasicTransducer_longest_path_size(self)
def _substitute_symbol(self, old_symbol, new_symbol, input_side=True, output_side=True):
return _libhfst.HfstBasicTransducer__substitute_symbol(self, old_symbol, new_symbol, input_side, output_side)
def _substitute_symbol_pair(self, old_symbol_pair, new_symbol_pair):
return _libhfst.HfstBasicTransducer__substitute_symbol_pair(self, old_symbol_pair, new_symbol_pair)
def _substitute_symbol_pair_with_set(self, old_symbol_pair, new_symbol_pair_set):
return _libhfst.HfstBasicTransducer__substitute_symbol_pair_with_set(self, old_symbol_pair, new_symbol_pair_set)
def _substitute_symbol_pair_with_transducer(self, symbol_pair, transducer):
return _libhfst.HfstBasicTransducer__substitute_symbol_pair_with_transducer(self, symbol_pair, transducer)
def _substitute_symbols(self, substitutions):
return _libhfst.HfstBasicTransducer__substitute_symbols(self, substitutions)
def _substitute_symbol_pairs(self, substitutions):
return _libhfst.HfstBasicTransducer__substitute_symbol_pairs(self, substitutions)
def insert_freely(self, *args):
return _libhfst.HfstBasicTransducer_insert_freely(self, *args)
def sort_arcs(self):
return _libhfst.HfstBasicTransducer_sort_arcs(self)
def disjunct(self, spv, weight):
return _libhfst.HfstBasicTransducer_disjunct(self, spv, weight)
def harmonize(self, another):
return _libhfst.HfstBasicTransducer_harmonize(self, another)
def _lookup(self, lookup_path, infinite_cutoff, max_weight, obey_flags):
return _libhfst.HfstBasicTransducer__lookup(self, lookup_path, infinite_cutoff, max_weight, obey_flags)
def get_prolog_string(self, write_weights):
return _libhfst.HfstBasicTransducer_get_prolog_string(self, write_weights)
def get_xfst_string(self, write_weights):
return _libhfst.HfstBasicTransducer_get_xfst_string(self, write_weights)
def get_att_string(self, write_weights):
return _libhfst.HfstBasicTransducer_get_att_string(self, write_weights)
def __str__(self):
return _libhfst.HfstBasicTransducer___str__(self)
def add_transition(self, *args):
return _libhfst.HfstBasicTransducer_add_transition(self, *args)
def transitions(self, s):
"""
...
"""
tr = self._transitions(s)
retval = []
for i in range(0, len(tr)):
retval.append(tr[i])
return retval
def states_and_transitions(self):
"""
...
"""
retval = []
for s in self.states():
retval.append(self.transitions(s))
return retval
def __iter__(self):
"""
Return states and transitions of the transducer.
"""
return self.states_and_transitions().__iter__()
def __enumerate__(self):
"""
Return an enumeration of states and transitions of the transducer.
"""
return enumerate(self.states_and_transitions())
def write_prolog(self, f, write_weights=True):
"""
Write the transducer in prolog format with name *name* to file *f*,
*write_weights* defined whether weights are written.
Parameters
----------
* `f` :
A python file where the transducer is written.
* `write_weights` :
Whether weights are written.
"""
prologstr = self.get_prolog_string(write_weights)
f.write(prologstr)
def write_xfst(self, f, write_weights=True):
"""
Write the transducer in xfst format to file *f*, *write_weights* defined whether
weights are written.
Parameters
----------
* `f` :
A python file where transducer is written.
* `write_weights` :
Whether weights are written.
"""
xfststr = self.get_xfst_string(write_weights)
f.write(prologstr)
def write_att(self, f, write_weights=True):
"""
Write the transducer in AT&T format to file *f*, *write_weights* defined whether
weights are written.
Parameters
----------
* `f` :
A python file where transducer is written.
* `write_weights` :
Whether weights are written.
"""
attstr = self.get_att_string(write_weights)
f.write(attstr)
def lookup(self, lookup_path, **kvargs):
"""
Lookup tokenized input *input* in the transducer.
Parameters
----------
* `str` :
A list/tuple of strings to look up.
* `kvargs` :
infinite_cutoff=-1, max_weight=None, obey_flags=False
* `max_epsilon_loops` :
How many times epsilon input loops are followed. Defaults to -1, i.e. infinitely.
* `max_weight` :
What is the maximum weight of a result allowed. Defaults to None, i.e. infinity.
* `obey_flags` :
Whether flag diacritic constraints are obeyed. Defaults to False.
"""
max_weight = None
max_epsilon_loops = None
obey_flags = False
output='dict' # 'dict' (default), 'text', 'raw'
for k,v in kvargs.items():
if k == 'max_weight' :
max_weight=v
elif k == 'max_epsilon_loops' :
infinite_cutoff=v
elif k == 'obey_flags' :
obey_flags=v
elif k == 'output':
if v == 'text':
output == 'text'
elif v == 'raw':
output='raw'
elif v == 'dict':
output='dict'
else:
print('Warning: ignoring argument %s as it has value %s.' % (k, v))
print("Possible values are 'dict' (default), 'text', 'raw'.")
else:
print('Warning: ignoring unknown argument %s.' % (k))
retval = self._lookup(lookup_path, max_epsilon_loops, max_weight, obey_flags)
if output == 'text':
return _two_level_paths_to_string(retval)
elif output == 'dict':
return _two_level_paths_to_dict(retval)
else:
return retval
def substitute(self, s, S=None, **kvargs):
"""
Substitute symbols or transitions in the transducer.
Parameters
----------
* `s` :
The symbol or transition to be substituted. Can also be a dictionary of
substitutions, if S == None.
* `S` :
The symbol, transition, a tuple of transitions or a transducer
(hfst.HfstBasicTransducer) that substitutes *s*.
* `kvargs` :
Arguments recognized are 'input' and 'output', their values can be False or
True, True being the default. These arguments are valid only if *s* and *S*
are strings, else they are ignored.
* `input` :
Whether substitution is performed on input side, defaults to True. Valid
only if *s* and *S* are strings.
* `output` :
Whether substitution is performed on output side, defaults to True. Valid
only if *s* and *S* are strings.
Possible combinations of arguments and their types are:
(1) substitute(str, str, input=bool, output=bool): substitute symbol with symbol
on input, output or both sides of each transition in the transducer. (2)
substitute(strpair, strpair): substitute transition with transition (3)
substitute(strpair, strpairtuple): substitute transition with several
transitions (4) substitute(strpair, transducer): substitute transition with a
transducer (5) substitute(dict): perform several symbol-to-symbol substitutions
(6) substitute(dict): perform several transition-to-transition substitutions
Examples:
(1) tr.substitute('a', 'A', input=True, output=False): substitute lowercase a:s
with uppercase ones (2) tr.substitute(('a','b'),('A','B')): substitute
transitions that map lowercase a into lowercase b with transitions that map
uppercase a into uppercase b (3) tr.substitute(('a','b'),
(('A','B'),('a','B'),('A','b'))): change either or both sides of a transition
[a:b] to uppercase (4) tr.substitute(('a','b'), hfst.regex('[a:b]+')) change
[a:b] transition into one or more consecutive [a:b] transitions (5)
tr.substitute({'a':'A', 'b':'B', 'c':'C'}) change lowercase a, b and c into
their uppercase variants (6) tr.substitute( {('a','a'):('A','A'),
('b','b'):('B','B'), ('c','c'):('C','C')} ): change lowercase a, b and c into
their uppercase variants
In case (4), epsilon transitions are used to attach copies of transducer *S*
between the SOURCE and TARGET state of each transition that is substituted. The
transition itself is deleted, but its weight is copied to the epsilon transition
leading from SOURCE to the initial state of *S*. Each final state of *S* is made
non-final and an epsilon transition leading to TARGET is attached to it. The
final weight is copied to the epsilon transition.
"""
if S == None:
if not isinstance(s, dict):
raise RuntimeError('First input argument must be a dictionary.')
subst_type=""
for k, v in s.items():
if _is_string(k):
if subst_type == "":
subst_type="string"
elif subst_type == "string pair":
raise RuntimeError('')
if not _is_string(v):
raise RuntimeError('')
elif _is_string_pair(k):
if subst_type == "":
subst_type="string pair"
elif subst_type == "string":
raise RuntimeError('')
if not _is_string_pair(v):
raise RuntimeError('')
else:
raise RuntimeError('')
if subst_type == "string":
return self._substitute_symbols(s)
else:
return self._substitute_symbol_pairs(s)
if _is_string(s):
if _is_string(S):
input=True
output=True
for k,v in kvargs.items():
if k == 'input':
if v == False:
input=False
elif k == 'output':
if v == False:
output=False
else:
raise RuntimeError('Free argument not recognized.')
return self._substitute_symbol(s, S, input, output)
else:
raise RuntimeError('...')
elif _is_string_pair(s):
if _is_string_pair(S):
return self._substitute_symbol_pair(s, S)
elif _is_string_pair_vector(S):
return self._substitute_symbol_pair_with_set(s, S)
elif isinstance(S, HfstBasicTransducer):
return self._substitute_symbol_pair_with_transducer(s, S)
else:
raise RuntimeError('...')
else:
raise RuntimeError('...')
__swig_destroy__ = _libhfst.delete_HfstBasicTransducer
__del__ = lambda self: None
HfstBasicTransducer_swigregister = _libhfst.HfstBasicTransducer_swigregister
HfstBasicTransducer_swigregister(HfstBasicTransducer)
class HfstBasicTransition(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, HfstBasicTransition, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, HfstBasicTransition, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_HfstBasicTransition(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_HfstBasicTransition
__del__ = lambda self: None
def get_target_state(self):
return _libhfst.HfstBasicTransition_get_target_state(self)
def get_input_symbol(self):
return _libhfst.HfstBasicTransition_get_input_symbol(self)
def set_input_symbol(self, symbol):
return _libhfst.HfstBasicTransition_set_input_symbol(self, symbol)
def get_output_symbol(self):
return _libhfst.HfstBasicTransition_get_output_symbol(self)
def set_output_symbol(self, symbol):
return _libhfst.HfstBasicTransition_set_output_symbol(self, symbol)
def get_weight(self):
return _libhfst.HfstBasicTransition_get_weight(self)
def set_weight(self, f):
return _libhfst.HfstBasicTransition_set_weight(self, f)
def __str__(self):
return _libhfst.HfstBasicTransition___str__(self)
HfstBasicTransition_swigregister = _libhfst.HfstBasicTransition_swigregister
HfstBasicTransition_swigregister(HfstBasicTransition)
class XreCompiler(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XreCompiler, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XreCompiler, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_XreCompiler(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def define_list(self, name, symbol_list):
return _libhfst.XreCompiler_define_list(self, name, symbol_list)
def define_function(self, name, arguments, xre):
return _libhfst.XreCompiler_define_function(self, name, arguments, xre)
def is_definition(self, name):
return _libhfst.XreCompiler_is_definition(self, name)
def is_function_definition(self, name):
return _libhfst.XreCompiler_is_function_definition(self, name)
def undefine(self, name):
return _libhfst.XreCompiler_undefine(self, name)
def compile(self, xre):
return _libhfst.XreCompiler_compile(self, xre)
def set_verbosity(self, verbose):
return _libhfst.XreCompiler_set_verbosity(self, verbose)
def getOutputToConsole(self):
return _libhfst.XreCompiler_getOutputToConsole(self)
def set_expand_definitions(self, expand):
return _libhfst.XreCompiler_set_expand_definitions(self, expand)
def define_xre(self, name, xre):
return _libhfst.XreCompiler_define_xre(self, name, xre)
def define_transducer(self, name, transducer):
return _libhfst.XreCompiler_define_transducer(self, name, transducer)
def setOutputToConsole(self, value):
return _libhfst.XreCompiler_setOutputToConsole(self, value)
__swig_destroy__ = _libhfst.delete_XreCompiler
__del__ = lambda self: None
XreCompiler_swigregister = _libhfst.XreCompiler_swigregister
XreCompiler_swigregister(XreCompiler)
class LexcCompiler(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, LexcCompiler, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, LexcCompiler, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_LexcCompiler(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def setVerbosity(self, verbose):
return _libhfst.LexcCompiler_setVerbosity(self, verbose)
def setOutputToConsole(self, arg2):
return _libhfst.LexcCompiler_setOutputToConsole(self, arg2)
__swig_destroy__ = _libhfst.delete_LexcCompiler
__del__ = lambda self: None
LexcCompiler_swigregister = _libhfst.LexcCompiler_swigregister
LexcCompiler_swigregister(LexcCompiler)
class XfstCompiler(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XfstCompiler, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XfstCompiler, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_XfstCompiler(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def setOutputToConsole(self, value):
return _libhfst.XfstCompiler_setOutputToConsole(self, value)
def setReadInteractiveTextFromStdin(self, Value):
return _libhfst.XfstCompiler_setReadInteractiveTextFromStdin(self, Value)
def setReadline(self, value):
return _libhfst.XfstCompiler_setReadline(self, value)
def setVerbosity(self, verbosity):
return _libhfst.XfstCompiler_setVerbosity(self, verbosity)
def set(self, name, text):
return _libhfst.XfstCompiler_set(self, name, text)
def get_prompt(self):
return _libhfst.XfstCompiler_get_prompt(self)
def apply_up(self, indata):
return _libhfst.XfstCompiler_apply_up(self, indata)
def apply_down(self, indata):
return _libhfst.XfstCompiler_apply_down(self, indata)
def parse_line(self, line):
return _libhfst.XfstCompiler_parse_line(self, line)
def quit_requested(self):
return _libhfst.XfstCompiler_quit_requested(self)
__swig_destroy__ = _libhfst.delete_XfstCompiler
__del__ = lambda self: None
XfstCompiler_swigregister = _libhfst.XfstCompiler_swigregister
XfstCompiler_swigregister(XfstCompiler)
def get_hfst_regex_error_message():
return _libhfst.get_hfst_regex_error_message()
get_hfst_regex_error_message = _libhfst.get_hfst_regex_error_message
def hfst_regex(comp, regex_string, error_stream):
return _libhfst.hfst_regex(comp, regex_string, error_stream)
hfst_regex = _libhfst.hfst_regex
def get_hfst_xfst_string_one():
return _libhfst.get_hfst_xfst_string_one()
get_hfst_xfst_string_one = _libhfst.get_hfst_xfst_string_one
def get_hfst_xfst_string_two():
return _libhfst.get_hfst_xfst_string_two()
get_hfst_xfst_string_two = _libhfst.get_hfst_xfst_string_two
def hfst_compile_xfst_to_string_one(comp, input):
return _libhfst.hfst_compile_xfst_to_string_one(comp, input)
hfst_compile_xfst_to_string_one = _libhfst.hfst_compile_xfst_to_string_one
def hfst_compile_xfst(comp, input, output_stream, error_stream):
return _libhfst.hfst_compile_xfst(comp, input, output_stream, error_stream)
hfst_compile_xfst = _libhfst.hfst_compile_xfst
def get_hfst_lexc_output():
return _libhfst.get_hfst_lexc_output()
get_hfst_lexc_output = _libhfst.get_hfst_lexc_output
def hfst_compile_lexc(comp, filename, error_stream):
return _libhfst.hfst_compile_lexc(comp, filename, error_stream)
hfst_compile_lexc = _libhfst.hfst_compile_lexc
def get_hfst_sfst_output():
return _libhfst.get_hfst_sfst_output()
get_hfst_sfst_output = _libhfst.get_hfst_sfst_output
def hfst_compile_sfst(filename, error_stream, verbose, output_to_console):
return _libhfst.hfst_compile_sfst(filename, error_stream, verbose, output_to_console)
hfst_compile_sfst = _libhfst.hfst_compile_sfst
def one_level_paths_to_string(arg1):
return _libhfst.one_level_paths_to_string(arg1)
one_level_paths_to_string = _libhfst.one_level_paths_to_string
def two_level_paths_to_string(arg1):
return _libhfst.two_level_paths_to_string(arg1)
two_level_paths_to_string = _libhfst.two_level_paths_to_string
def parse_prolog_network_line(line, graph):
return _libhfst.parse_prolog_network_line(line, graph)
parse_prolog_network_line = _libhfst.parse_prolog_network_line
def parse_prolog_arc_line(line, graph):
return _libhfst.parse_prolog_arc_line(line, graph)
parse_prolog_arc_line = _libhfst.parse_prolog_arc_line
def parse_prolog_symbol_line(line, graph):
return _libhfst.parse_prolog_symbol_line(line, graph)
parse_prolog_symbol_line = _libhfst.parse_prolog_symbol_line
def parse_prolog_final_line(line, graph):
return _libhfst.parse_prolog_final_line(line, graph)
parse_prolog_final_line = _libhfst.parse_prolog_final_line
def set_default_fst_type(t):
"""
Set the default implementation type.
Parameters
----------
* `impl` :
An hfst.ImplementationType.
Set the implementation type (SFST_TYPE, TROPICAL_OPENFST_TYPE, FOMA_TYPE) that
is used by default by all operations that create transducers. The default value
is TROPICAL_OPENFST_TYPE
"""
return _libhfst.set_default_fst_type(t)
def get_default_fst_type():
"""
Get default transducer implementation type.
If the default type is not set, it defaults to hfst.ImplementationType.TROPICAL_OPENFST_TYPE
"""
return _libhfst.get_default_fst_type()
def fst_type_to_string(t):
"""
Get a string representation of transducer implementation type *type*.
Parameters
----------
* `type` :
An hfst.ImplementationType.
"""
return _libhfst.fst_type_to_string(t)
def two_level_if(context, mappings, alphabet):
return _libhfst.two_level_if(context, mappings, alphabet)
two_level_if = _libhfst.two_level_if
def two_level_only_if(context, mappings, alphabet):
return _libhfst.two_level_only_if(context, mappings, alphabet)
two_level_only_if = _libhfst.two_level_only_if
def two_level_if_and_only_if(context, mappings, alphabet):
return _libhfst.two_level_if_and_only_if(context, mappings, alphabet)
two_level_if_and_only_if = _libhfst.two_level_if_and_only_if
def replace_down_karttunen(context, mapping, optional, alphabet):
return _libhfst.replace_down_karttunen(context, mapping, optional, alphabet)
replace_down_karttunen = _libhfst.replace_down_karttunen
def replace_right(context, mapping, optional, alphabet):
return _libhfst.replace_right(context, mapping, optional, alphabet)
replace_right = _libhfst.replace_right
def replace_left(context, mapping, optional, alphabet):
return _libhfst.replace_left(context, mapping, optional, alphabet)
replace_left = _libhfst.replace_left
def replace_up(mapping, optional, alphabet):
return _libhfst.replace_up(mapping, optional, alphabet)
replace_up = _libhfst.replace_up
def replace_down(*args):
return _libhfst.replace_down(*args)
replace_down = _libhfst.replace_down
def left_replace_up(*args):
return _libhfst.left_replace_up(*args)
left_replace_up = _libhfst.left_replace_up
def left_replace_down(context, mapping, optional, alphabet):
return _libhfst.left_replace_down(context, mapping, optional, alphabet)
left_replace_down = _libhfst.left_replace_down
def left_replace_down_karttunen(context, mapping, optional, alphabet):
return _libhfst.left_replace_down_karttunen(context, mapping, optional, alphabet)
left_replace_down_karttunen = _libhfst.left_replace_down_karttunen
def left_replace_left(context, mapping, optional, alphabet):
return _libhfst.left_replace_left(context, mapping, optional, alphabet)
left_replace_left = _libhfst.left_replace_left
def left_replace_right(context, mapping, optional, alphabet):
return _libhfst.left_replace_right(context, mapping, optional, alphabet)
left_replace_right = _libhfst.left_replace_right
def restriction(contexts, mapping, alphabet):
return _libhfst.restriction(contexts, mapping, alphabet)
restriction = _libhfst.restriction
def coercion(contexts, mapping, alphabet):
return _libhfst.coercion(contexts, mapping, alphabet)
coercion = _libhfst.coercion
def restriction_and_coercion(contexts, mapping, alphabet):
return _libhfst.restriction_and_coercion(contexts, mapping, alphabet)
restriction_and_coercion = _libhfst.restriction_and_coercion
def surface_restriction(contexts, mapping, alphabet):
return _libhfst.surface_restriction(contexts, mapping, alphabet)
surface_restriction = _libhfst.surface_restriction
def surface_coercion(contexts, mapping, alphabet):
return _libhfst.surface_coercion(contexts, mapping, alphabet)
surface_coercion = _libhfst.surface_coercion
def surface_restriction_and_coercion(contexts, mapping, alphabet):
return _libhfst.surface_restriction_and_coercion(contexts, mapping, alphabet)
surface_restriction_and_coercion = _libhfst.surface_restriction_and_coercion
def deep_restriction(contexts, mapping, alphabet):
return _libhfst.deep_restriction(contexts, mapping, alphabet)
deep_restriction = _libhfst.deep_restriction
def deep_coercion(contexts, mapping, alphabet):
return _libhfst.deep_coercion(contexts, mapping, alphabet)
deep_coercion = _libhfst.deep_coercion
def deep_restriction_and_coercion(contexts, mapping, alphabet):
return _libhfst.deep_restriction_and_coercion(contexts, mapping, alphabet)
deep_restriction_and_coercion = _libhfst.deep_restriction_and_coercion
class TwolcCompiler(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, TwolcCompiler, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, TwolcCompiler, name)
__repr__ = _swig_repr
if _newclass:
compile = staticmethod(_libhfst.TwolcCompiler_compile)
else:
compile = _libhfst.TwolcCompiler_compile
def __init__(self):
this = _libhfst.new_TwolcCompiler()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_TwolcCompiler
__del__ = lambda self: None
TwolcCompiler_swigregister = _libhfst.TwolcCompiler_swigregister
TwolcCompiler_swigregister(TwolcCompiler)
def TwolcCompiler_compile(inputfile, outputfile, silent, verbose, resolve_left_conflicts, resolve_right_conflicts, type):
return _libhfst.TwolcCompiler_compile(inputfile, outputfile, silent, verbose, resolve_left_conflicts, resolve_right_conflicts, type)
TwolcCompiler_compile = _libhfst.TwolcCompiler_compile
class PmatchContainer(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, PmatchContainer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, PmatchContainer, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _libhfst.new_PmatchContainer(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _libhfst.delete_PmatchContainer
__del__ = lambda self: None
def match(self, input, time_cutoff=0.0):
return _libhfst.PmatchContainer_match(self, input, time_cutoff)
def get_profiling_info(self):
return _libhfst.PmatchContainer_get_profiling_info(self)
def set_verbose(self, b):
return _libhfst.PmatchContainer_set_verbose(self, b)
def set_profile(self, b):
return _libhfst.PmatchContainer_set_profile(self, b)
PmatchContainer_swigregister = _libhfst.PmatchContainer_swigregister
PmatchContainer_swigregister(PmatchContainer)
class ImplementationType:
"""
Back-end implementation.
Attributes:
SFST_TYPE: SFST type, unweighted
TROPICAL_OPENFST_TYPE: OpenFst type with tropical weights
LOG_OPENFST_TYPE: OpenFst type with logarithmic weights (limited support)
FOMA_TYPE: FOMA type, unweighted
XFSM_TYPE: XFST type, unweighted (limited support)
HFST_OL_TYPE: HFST optimized-lookup type, unweighted
HFST_OLW_TYPE: HFST optimized-lookup type, weighted
HFST2_TYPE: HFST version 2 legacy type
UNSPECIFIED_TYPE: type not specified
ERROR_TYPE: (something went wrong)
"""
SFST_TYPE = _libhfst.SFST_TYPE
TROPICAL_OPENFST_TYPE = _libhfst.TROPICAL_OPENFST_TYPE
LOG_OPENFST_TYPE = _libhfst.LOG_OPENFST_TYPE
FOMA_TYPE = _libhfst.FOMA_TYPE
XFSM_TYPE = _libhfst.XFSM_TYPE
HFST_OL_TYPE = _libhfst.HFST_OL_TYPE
HFST_OLW_TYPE = _libhfst.HFST_OLW_TYPE
HFST2_TYPE = _libhfst.HFST2_TYPE
UNSPECIFIED_TYPE = _libhfst.UNSPECIFIED_TYPE
ERROR_TYPE = _libhfst.ERROR_TYPE
class ReplaceType:
"""
Replace type in Xerox-type rules.
Attributes:
REPL_UP: Match contexts on input level
REPL_DOWN: Match contexts on output level
REPL_RIGHT: Match left contexts on input level and right contexts on output level
REPL_LEFT: Match left contexts on output level and right contexts on input level
"""
REPL_UP = _libhfst.REPL_UP
REPL_DOWN = _libhfst.REPL_DOWN
REPL_RIGHT = _libhfst.REPL_RIGHT
REPL_LEFT = _libhfst.REPL_LEFT
# This file is compatible with both classic and new-style classes.
|