Merge pull request #326 from vrtareg/master
Add Miles/yard to configuration and commit/check TTS voice for yards
This commit is contained in:
commit
efba471f8b
2 changed files with 24 additions and 15 deletions
|
@ -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(Dist) == D :- measure('mi-f'), distance_mi_f(Dist) == D.
|
||||
distance(Dist) == D :- measure('mi-y'), distance_mi_y(Dist) == D.
|
||||
|
||||
%%% 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
|
||||
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 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
|
||||
|
|
|
@ -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<entries.length; i++){
|
||||
entries[i] = mvls[i].toHumanString(this);
|
||||
|
|
Loading…
Reference in a new issue