File: __init__.py

package info (click to toggle)
lttoolbox 3.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,516 kB
  • sloc: cpp: 13,541; ansic: 3,131; python: 1,212; makefile: 17
file content (54 lines) | stat: -rw-r--r-- 1,893 bytes parent folder | download | duplicates (3)
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
# -*- coding: utf-8 -*-
import unittest
from basictest import PrintTest


class NonWeightedFst(unittest.TestCase, PrintTest):
    printdix = "data/biproc-skips-tags-mono.dix"
    printdir = "lr"
    expectedOutput = "0\t1\tv\tv\t0.000000\t\n1\t2\ti\ti\t0.000000\t\n2\t3\th\th\t0.000000\t\n3\t4\tk\tk\t0.000000\t\n4\t5\ti\ti\t0.000000\t\n5\t6\t<KEPT>\t<KEPT>\t0.000000\t\n6\t10\t\u03b5\t\u03b5\t0.000000\t\n6\t7\t<MATCHSOFAR>\t<MATCHSOFAR>\t0.000000\t\n7\t8\t<STILLMATCHING>\t<STILLMATCHING>\t0.000000\t\n8\t9\t<NONMATCHL>\t<NONMATCHR>\t0.000000\t\n9\t10\t\u03b5\t\u03b5\t0.000000\t\n10\t0.000000\n"


class WeightedFst(unittest.TestCase, PrintTest):
    printdix = "data/cat-weight.att"
    printdir = "lr"
    expectedOutput = "0\t1\tc\tc\t4.567895\t\n1\t2\ta\ta\t0.989532\t\n2\t3\tt\tt\t2.796193\t\n3\t4\tε\t+\t0.824564\t\n4\t5\tε\tn\t1.824564\t\n4\t5\tε\tv\t2.856296\t\n5\t0.525487\n"


class NegativeWeightedFst(unittest.TestCase, PrintTest):
    printdix = "data/cat-weight-negative.att"
    printdir = "lr"
    expectedOutput = "0\t1\tc\tc\t4.567895\t\n1\t2\ta\ta\t0.989532\t\n2\t3\tt\tt\t2.796193\t\n3\t4\tε\t+\t-0.824564\t\n4\t5\tε\tn\t1.824564\t\n4\t5\tε\tv\t2.856296\t\n5\t-0.525487\n"


class MulticharCompFst(unittest.TestCase, PrintTest):
    printdix = "data/multichar.att"
    printdir = "lr"
    expectedOutput = "0\t1\tא\tא\t0.000000\t\n1\t2\tε\tַ\t0.000000\t\n2\t3\tε\tן\t0.000000\t\n3\t4\tε\t<blah>\t0.000000\t\n4\t0.000000\n"


class SectionsFst(unittest.TestCase, PrintTest):
    printdix = "data/sections.dix"
    printdir = "lr"
    expectedOutput = """0\t1\t.\t.\t0.000000\t
1\t2\tε\t<sent>\t0.000000\t
2\t0.000000
--
0\t1\tX\tX\t0.000000\t
1\t2\tε\t<np>\t0.000000\t
2\t0.000000
"""


class Alphabet(unittest.TestCase, PrintTest):
    printdix = "data/alphabet.att"
    printdir = "lr"
    printflags = ["-a"]
    expectedOutput = """A
B
C
a
b
c
<h>
"""