From a56c3454886c4db81be86030ab362a8c58a26b2b Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 14 Aug 2011 21:38:47 +0200 Subject: [PATCH] Fix russian plural km --- OsmAnd/voice/ru-tts/_ttsconfig.p | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/OsmAnd/voice/ru-tts/_ttsconfig.p b/OsmAnd/voice/ru-tts/_ttsconfig.p index 1c1737ae9d..258e75b462 100644 --- a/OsmAnd/voice/ru-tts/_ttsconfig.p +++ b/OsmAnd/voice/ru-tts/_ttsconfig.p @@ -63,11 +63,17 @@ nth(16, 'шестнадцатый '). nth(17, 'семнадцатый '). %%% distance measure -distance(Dist) == [ X, ' meters'] :- Dist < 100, D is round(Dist/10)*10, num_atom(D, X). -distance(Dist) == [ X, ' meters'] :- Dist < 1000, D is round(2*Dist/100)*50, num_atom(D, X). -distance(Dist) == ['более одного километра '] :- Dist < 1500. -distance(Dist) == ['около ', X, ' километов '] :- Dist < 10000, D is round(Dist/1000), num_atom(D, X). -distance(Dist) == [ X, ' километов '] :- D is round(Dist/1000), num_atom(D, X). +distance(Dist) == [ X, ' метров'] :- Dist < 100, D is round(Dist/10)*10, num_atom(D, X). +distance(Dist) == [ X, ' метров'] :- Dist < 1000, D is round(2*Dist/100)*50, num_atom(D, X). +distance(Dist) == ['около одного километра '] :- Dist < 1500. +distance(Dist) == ['около ', X, Km] :- Dist < 10000, D is round(Dist/1000), num_atom(D, X), + plural_km(D, Km). + +plural_km(D, ' километр ') :- 1 is D mod 10. +plural_km(D, ' километра ') :- Mod is D mod 10, Mod < 5. +plural_km(_D, ' километров '). + +distance(Dist) == [ X, ' километров '] :- D is round(Dist/1000), num_atom(D, X). %% resolve command main method %% if you are familar with Prolog you can input specific to the whole mechanism,