spaCy/spacy/tests/lang/tr/test_text.py
Duygu Altinok b95a11dd95
Ordinal numbers for Turkish (#6142)
* minor ordinal number addition

* fixed typo

* added corresponding lexical test
2020-10-07 10:25:37 +02:00

33 lines
623 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.lang.tr.lex_attrs import like_num
@pytest.mark.parametrize(
"word",
[
"bir",
"iki",
"dört",
"altı",
"milyon",
"100",
"birinci",
"üçüncü",
"beşinci",
"100üncü",
"8inci"
]
)
def test_tr_lex_attrs_like_number_cardinal_ordinal(word):
assert like_num(word)
@pytest.mark.parametrize("word", ["beş", "yedi", "yedinci", "birinci"])
def test_tr_lex_attrs_capitals(word):
assert like_num(word)
assert like_num(word.upper())