Skip to content

Commit

Permalink
Address requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Nov 27, 2020
1 parent 6813b4b commit efda8f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions lingua_franca/lang/parse_sl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO implement parsing function
2 changes: 1 addition & 1 deletion lingua_franca/res/text/sl-si/normalize.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"lowercase": false,
"numbers_to_digits": true,
"expand_contractions": true,
"expand_contractions": false,
"remove_symbols": false,
"remove_accents": false,
"remove_articles": false,
Expand Down
15 changes: 8 additions & 7 deletions test/test_format_sl.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ def test_ordinals(self):
self.assertEqual(pronounce_number(18e18, ordinals=True,
short_scale=False), "osemnajsttrilijonti")

# def nice_time(dt, lang="en-us", speech=True, use_24hour=False,
# use_ampm=False):


class TestNiceDateFormat(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -524,11 +521,15 @@ def test_nice_year(self):
# print(nice_year(dt, lang=lang))

def test_nice_duration(self):
self.assertEqual(nice_duration(1), "ena sekunda")
# TODO implement better plural support for nice_duration
# Correct results are in comments

# This should be "sekunde" but this is unsupported
# Because nice_duration only supports basic singular and plural
self.assertEqual(nice_duration(3), "tri sekund")
self.assertEqual(nice_duration(1), "ena sekunda")
self.assertEqual(nice_duration(2), "dve sekund") # dve sekundi
self.assertEqual(nice_duration(3), "tri sekund") # tri sekunde
self.assertEqual(nice_duration(4), "štiri sekund") # štiri sekunde
self.assertEqual(nice_duration(5), "pet sekund")
self.assertEqual(nice_duration(6), "šest sekund")

self.assertEqual(nice_duration(1, speech=False), "0:01")
self.assertEqual(nice_duration(61), "ena minuta ena sekunda")
Expand Down

0 comments on commit efda8f4

Please sign in to comment.