def test_analyze_concatenation(english_ipa_fst: FST): """ Test that concatenation of the analysis works as expected when all elements include epsilons. """ result, = english_ipa_fst.analyze('rough') assert result == ('ɹʌf', )
def test_cree_hfstol_analysis(cree_hfstol_analyzer: FST, surface_form, analyses): """ Test that cree hfstol work """ assert set(cree_hfstol_analyzer.analyze(surface_form)) == { ''.join(x) for x in analyses }
def test_analyze_form_outside_of_alphabet(eat_fst: FST): """ Analyzing forms with characters outside of the lower alphabet should reject instantly. """ assert set(eat_fst.analyze('mîcisow')) == set()
def test_unacceptable_forms_in_flag_fst(unacceptable_form: str, english_flags_fst: FST): """ Analyze forms that should not transduce on an FST **WITH** simple flag diacritics. """ assert set(english_flags_fst.analyze(unacceptable_form)) == set()
def test_flag_fst(surface_form: str, analysis, english_flags_fst: FST): """ Analyze and generate on an FST **WITH** simple flag diacritics. """ assert set(english_flags_fst.analyze(surface_form)) == {analysis} assert set(english_flags_fst.generate(''.join(analysis))) == {surface_form}
def test_analyze_eat_fst(surface_form: str, analyses: set, eat_fst: FST): """ Apply up (analyze) on an FST **WITHOUT** flag diacritics. """ assert set(eat_fst.analyze(surface_form)) == analyses
def test_cree_foma_analysis(cree_foma_analyzer: FST, surface_form, analyses): """ Test that cree fomabin work """ assert set(cree_foma_analyzer.analyze(surface_form)) == set(analyses)