CNL 2012, Zurich, 2012-08-31
CNL 2012, Zurich, 2012-08-31
09:45
<command> = <action> | (<action> and <command>); <action> = stop {STOP} | start | pause | resume | finish {STOP};
-- Unitconv/Unit.gf (abstract grammar) speed : LengthUnit -> TimeUnit -> SpeedUnit ; time_unit : Time -> TimeUnit ; second, minute, hour, day, week, month, year, decade, century : Time ;
-- Unitconv/UnitEst.gf (concrete grammar for Estonian) speed = mk_meter_per_second ""; minute = mkUnit "minutit"; hour = mkUnit "tundi" "tunnis" "tundides";
-- Unitconv/UnitApp.gf (concrete grammar for a machine language) speed = infixSS_glue "/"; -- e.g. "km/h" minute = ss "min"; hour = ss "h";
-- lib/*.gf (resources) ss : Str -> SS = \s -> {s = s} ; infixSS_glue : Str -> SS -> SS -> SS = \f,x,y -> ss (glue x.s f y.s) ;
Action | covers everything, i.e. Alarm + Direction + Calc |
Alarm | simple 24h-clock, e.g. "alarm 06:05", "alarm in 20 minutes" |
Calc | Expr + Unitconv; optional prefix "kui palju on" (how much is) to help ASR |
Direction | FROM-TO queries over Estonian place names and Tallinn's street addresses |
Expr | arithmetical expressions, e.g. (((1 + -2.3) * PI) ^ 5) |
Numeral | integers -10^12–10^12; imported by most other grammars |
Symbols, Estvrp | sequence of digits and letters |
Unitconv | unit and currency conversion expressions, e.g. convert 12.34 km^2 to ft^2 |
Est: algus sõpruse puiestee kakssada neliteist lõpp lossi plats kaks App: FROM Sõpruse puiestee 214, Tallinn TO Lossi plats 2, Tallinn
(August|A) Weizenbergi (tänav) 39
Est: sada koma üks miili ruut tunnis meetrites ruut sekundis App: convert 100.1 mi*h^-2 to m*s^-2
USD
can be expressed by "dollar", "ameerika dollar" or "ameerika raha"Est: Pii pluss üks miinus kaks korda kolm jagatud neli astmel viis App: (((((PI + 1) - 2) * 3) / 4) ^ 5)
// Set of non-standard extras that K6nele supports public static final String EXTRA_GRAMMAR_URL = "ee.ioc.phon.android.extra.GRAMMAR_URL"; public static final String EXTRA_GRAMMAR_TARGET_LANG = "ee.ioc.phon.android.extra.GRAMMAR_TARGET_LANG"; // ... Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.setComponent(new ComponentName( "ee.ioc.phon.android.speak", "ee.ioc.phon.android.speak.RecognizerIntentActivity")); intent.putExtra(EXTRA_GRAMMAR_URL, "http://kaljurand.github.com/Grammars/grammars/pgf/Action.pgf"); intent.putExtra(EXTRA_GRAMMAR_TARGET_LANG, "App"); // ... startActivityForResult(intent, 1234);