From a7d42ce57e7ba4e98a4aa8316491b8a98e98cabe Mon Sep 17 00:00:00 2001 From: Areg Date: Mon, 15 Oct 2012 10:52:59 +0100 Subject: [PATCH 1/2] Added Miles/yard to voice/en-tts/ttsconfig.p --- OsmAnd/assets/voice/en-tts/ttsconfig.p | 37 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/OsmAnd/assets/voice/en-tts/ttsconfig.p b/OsmAnd/assets/voice/en-tts/ttsconfig.p index b49867f500..bd3fa86f41 100644 --- a/OsmAnd/assets/voice/en-tts/ttsconfig.p +++ b/OsmAnd/assets/voice/en-tts/ttsconfig.p @@ -68,21 +68,30 @@ nth(17, 'seventeenth '). distance(Dist) == D :- measure('km-m'), distance_km(Dist) == D. -distance(Dist) == D :- distance_mi(Dist) == D. -%%% distance measure -distance_km(Dist) == [ X, ' meters'] :- Dist < 100, D is round(Dist/10.0)*10, num_atom(D, X). -distance_km(Dist) == [ X, ' meters'] :- Dist < 1000, D is round(2*Dist/100.0)*50, num_atom(D, X). -distance_km(Dist) == ['about 1 kilometer '] :- Dist < 1500. -distance_km(Dist) == ['about ', X, ' kilometers '] :- Dist < 10000, D is round(Dist/1000.0), num_atom(D, X). -distance_km(Dist) == [ X, ' kilometers '] :- D is round(Dist/1000.0), num_atom(D, X). +distance(Dist) == D :- measure('mi-f'), distance_mi_f(Dist) == D. +distance(Dist) == D :- measure('mi-y'), distance_mi_y(Dist) == D. -%%% distance measure -distance_mi(Dist) == [ X, ' feet'] :- Dist < 160, D is round(2*Dist/100.0/0.3048)*50, num_atom(D, X). -distance_mi(Dist) == [ X, ' tenth of a mile'] :- Dist < 241, D is round(Dist/161.0), num_atom(D, X). -distance_mi(Dist) == [ X, ' tenths of a mile'] :- Dist < 1529, D is round(Dist/161.0), num_atom(D, X). -distance_mi(Dist) == ['about 1 mile '] :- Dist < 2414. -distance_mi(Dist) == ['about ', X, ' miles '] :- Dist < 16093, D is round(Dist/1609.0), num_atom(D, X). -distance_mi(Dist) == [ X, ' miles '] :- D is round(Dist/1609.0), num_atom(D, X). +%%% distance measure km/m +distance_km(Dist) == [ X, ' meters'] :- Dist < 100, D is round(Dist/10.0)*10, num_atom(D, X). +distance_km(Dist) == [ X, ' meters'] :- Dist < 1000, D is round(2*Dist/100.0)*50, num_atom(D, X). +distance_km(Dist) == ['about 1 kilometer '] :- Dist < 1500. +distance_km(Dist) == ['about ', X, ' kilometers '] :- Dist < 10000, D is round(Dist/1000.0), num_atom(D, X). +distance_km(Dist) == [ X, ' kilometers '] :- D is round(Dist/1000.0), num_atom(D, X). + +%%% distance measure mi/f +distance_mi_f(Dist) == [ X, ' feet'] :- Dist < 160, D is round(2*Dist/100.0/0.3048)*50, num_atom(D, X). +distance_mi_f(Dist) == [ X, ' tenth of a mile'] :- Dist < 241, D is round(Dist/161.0), num_atom(D, X). +distance_mi_f(Dist) == [ X, ' tenths of a mile'] :- Dist < 1529, D is round(Dist/161.0), num_atom(D, X). +distance_mi_f(Dist) == ['about 1 mile '] :- Dist < 2414. +distance_mi_f(Dist) == ['about ', X, ' miles '] :- Dist < 16093, D is round(Dist/1609.0), num_atom(D, X). +distance_mi_f(Dist) == [ X, ' miles '] :- D is round(Dist/1609.0), num_atom(D, X). + +%%% distance measure mi/y +distance_mi_y(Dist) == [ X, ' yards'] :- Dist < 241, D is round(Dist/10.0/0.9144)*10, num_atom(D, X). +distance_mi_y(Dist) == [ X, ' yards'] :- Dist < 1300, D is round(2*Dist/100.0/0.9144)*50, num_atom(D, X). +distance_mi_y(Dist) == ['about 1 mile '] :- Dist < 2414. +distance_mi_y(Dist) == ['about ', X, ' miles '] :- Dist < 16093, D is round(Dist/1609.0), num_atom(D, X). +distance_mi_y(Dist) == [ X, ' miles '] :- D is round(Dist/1609.0), num_atom(D, X). %% resolve command main method From 55f47a305aa73851597cb551c7a764cbe4504c3b Mon Sep 17 00:00:00 2001 From: Areg Date: Mon, 15 Oct 2012 11:12:15 +0100 Subject: [PATCH 2/2] Added Miles/yard to SettingsActivity.java --- OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java index 85c3fdea44..ddf51439d4 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java @@ -306,7 +306,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference new Integer[] {ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED}); - MetricsConstants[] mvls = new MetricsConstants[] {MetricsConstants.KILOMETERS_AND_METERS, MetricsConstants.MILES_AND_FOOTS}; //MetricsConstants.values(); + MetricsConstants[] mvls = new MetricsConstants[] {MetricsConstants.KILOMETERS_AND_METERS, MetricsConstants.MILES_AND_FOOTS, MetricsConstants.MILES_AND_YARDS}; //MetricsConstants.values(); entries = new String[mvls.length]; for(int i=0; i