Skip to content

Add testing framework for Python #21

@ronaldtse

Description

@ronaldtse

Port tests from Ruby to Python.

d_tests = [{'original' => '# گيله پسمير الجديد 34',
            'diacritized' => 'يَلِهُ سُمِيْرٌ الجَدِيدُ',
            'reconciled' => '# گيَلِهُ پسُمِيْرٌ الجَدِيدُ 34' },

           {'original' => 'abc',
            'diacritized' => '',
            'reconciled' => 'abc'},

           {'original' => '‘Iz. Ibrāhīm as-Sa‘danī',
            'diacritized' => '',
            'reconciled' => '‘Iz. Ibrāhīm as-Sa‘danī'},

           {'original' => '26 سبتمبر العقبة',
            'diacritized' => 'سَبْتَمْبَرِ العَقَبَة',
            'reconciled' => '26 سَبْتَمْبَرِ العَقَبَة'}]

d_tests.each {|d| \
    if not d['reconciled']==reconcile_strings(d['original'], d['diacritized'])
        raise Exception.new('reconcile string not matched')
    end
}

or:
for s in '# گيله پسمير الجديد 34' 'abc'  '‘Iz. Ibrāhīm as-Sa‘danī' '26 سبتمبر العقبة'
do;
    ruby rababa.rb -t $s -m '../models-data/diacritization_model.onnx'
done
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    High priority

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions