1
0
mirror of https://github.com/malarinv/jasper-asr.git synced 2026-03-08 10:32:35 +00:00

fix 11st to 11th in ordinal

This commit is contained in:
2020-06-17 19:30:12 +05:30
parent 8e238c254e
commit 62eefb9294

View File

@@ -2,6 +2,7 @@ import typer
from pathlib import Path from pathlib import Path
from random import randrange from random import randrange
from itertools import product from itertools import product
from math import floor
app = typer.Typer() app = typer.Typer()
@@ -33,7 +34,10 @@ def export_conv_json(
# ordinal from https://stackoverflow.com/questions/9647202/ordinal-numbers-replacement # ordinal from https://stackoverflow.com/questions/9647202/ordinal-numbers-replacement
def ordinal(n): def ordinal(n):
return "%d%s" % (n, "tsnrhtdd"[(n / 10 % 10 != 1) * (n % 10 < 4) * n % 10 :: 4]) return "%d%s" % (
n,
"tsnrhtdd"[(floor(n / 10) % 10 != 1) * (n % 10 < 4) * n % 10 :: 4],
)
def canon_vars(d, m): def canon_vars(d, m):
return [ return [