https://github.com/annotation/text-fabric
Raw File
Tip revision: c71f935dfb6c9722dabc98670e5024a3c68aed9b authored by Dirk Roorda on 04 January 2017, 12:49:58 UTC
New minor release 2.1.3
Tip revision: c71f935
tf-test.py
from tf.read import readFeature

testDir = 'tests'

def test_monads():
    result = readFeature('{}/{}.tf'.format('tests', 'monads'))

    if result == None:
        print('There were errors')
    else:
        (isEdge, metaData, data) = result
        label = 'edge' if isEdge else 'node'
        print('{} feature\n{}\nData: {} {}s'.format(
            label,
            '\n'.join('{:<20}: {}'.format(*x) for x in sorted(metaData.items())),
            len(data),
            label,
        ))

test_monads()
back to top