Beispiel #1
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)
Beispiel #2
0
def stroke_intersections_test():
    f = features.StrokeIntersections(strokes=4)
    recording = testhelper.get_symbol_as_handwriting(293035)
    x = f(recording)
    nose.tools.assert_equal(x, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0])
Beispiel #3
0
def stroke_intersection2_test():
    """A 't' has two strokes. They don't intersect themselves, but they
       intersect once."""
    recording = testhelper.get_symbol_as_handwriting(293035)
    feature = features.StrokeIntersections(2)
    nose.tools.assert_equal(feature(recording), [0, 1, 0])
Beispiel #4
0
def stroke_intersection1_test():
    """A '&' has one stroke. This stroke intersects itself once."""
    recording = testhelper.get_symbol_as_handwriting(97705)
    feature = features.StrokeIntersections(1)
    nose.tools.assert_equal(feature(recording), [2])
Beispiel #5
0
def test_stroke_intersections():
    f = features.StrokeIntersections(strokes=4)
    recording = testhelper.get_symbol_as_handwriting(293035)
    x = f(recording)
    assert x == [0, 1, 0, 0, 0, 0, 0, 0, 0, 0]
Beispiel #6
0
def test_stroke_intersection2():
    """A 't' has two strokes. They don't intersect themselves, but they
    intersect once."""
    recording = testhelper.get_symbol_as_handwriting(293035)
    feature = features.StrokeIntersections(2)
    assert feature(recording) == [0, 1, 0]
Beispiel #7
0
def test_stroke_intersection1():
    """A '&' has one stroke. This stroke intersects itself once."""
    recording = testhelper.get_symbol_as_handwriting(97705)
    feature = features.StrokeIntersections(1)
    assert feature(recording) == [2]