forked from rspeer/langcodes
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ignore_script option to compare spoken languages
- Loading branch information
1 parent
677ad3f
commit 51ad46b
Showing
2 changed files
with
67 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from langcodes import closest_match | ||
|
||
|
||
def test_language_less_than(): | ||
spoken_language_1 = 'pa' | ||
spoken_language_2 = 'pa-PK' | ||
match = closest_match( | ||
spoken_language_1, [spoken_language_2], ignore_script=True | ||
) | ||
print(match) | ||
assert match[0] != "und" | ||
|
||
|
||
def test_language_more_than(): | ||
spoken_language_1 = 'pa-PK' | ||
spoken_language_2 = 'pa' | ||
match = closest_match( | ||
spoken_language_1, [spoken_language_2], ignore_script=True | ||
) | ||
print(match) | ||
assert match[0] != "und" |