示例#1
0
def dimension_test():
    l = [(features.ConstantPointCoordinates(), 160),
         (features.FirstNPoints(), 162),  # TODO: Check
         (features.StrokeCount(), 1),
         (features.Ink(), 1)
         ]
    for alg, dimension in l:
        nose.tools.assert_equal(alg.get_dimension(), dimension)
示例#2
0
def repr_and_str_test():
    l = [features.ConstantPointCoordinates(),
         features.FirstNPoints(),
         features.StrokeCount(),
         features.Ink()
         ]
    for alg in l:
        str(alg)
        repr(alg)
示例#3
0
def test_dimension():
    algorithms = [
        (features.ConstantPointCoordinates(), 160),
        (features.FirstNPoints(), 162),  # TODO: Check
        (features.StrokeCount(), 1),
        (features.Ink(), 1),
    ]
    for algorithm, dimension in algorithms:
        assert algorithm.get_dimension() == dimension
示例#4
0
def test_repr_and_str():
    algorithms = [
        features.ConstantPointCoordinates(),
        features.FirstNPoints(),
        features.StrokeCount(),
        features.Ink(),
    ]
    for algorithm in algorithms:
        str(algorithm)
        repr(algorithm)
示例#5
0
def simple_execution_test():
    algorithms = [
        features.ConstantPointCoordinates(),
        features.ConstantPointCoordinates(strokes=0),
        features.FirstNPoints(),
        # features.Bitmap(),
        features.Ink(),
        features.AspectRatio(),
        features.Width(),
        features.Time(),
        features.CenterOfMass(),
        features.StrokeCenter(),
        features.StrokeCenter(8),
        features.StrokeIntersections(),
        features.ReCurvature()
    ]
    for algorithm in algorithms:
        recording = testhelper.get_symbol_as_handwriting(292934)
        algorithm(recording)