On Sunday 22 February 2009 04:52:44 Professor James Davenport wrote: > > More naturally from my point of view is treating [the unit abbreviation] > > problem as a problem of rendering OpenMath to presentation markup. For > > that, our (admittedly, > > No - it's a bi-directional problem, I think. If not, then your suggestion > is at least plausible.
I see. You're right, so far I've only touched the "content -> presentation" direction. When would the other direction apply? Are you talking about parsing? (E.g. parsing the input given to Jonathan's converter?) Then, an explicit markup for abbreviated units would make sense, as it would facilitate parsing. On the other hand, one could argue that this is a subproblem of the larger problem of parsing presentation markup back to content markup -- a problem that has not yet been solved sufficiently. > > not-yet-standard) approach is defining notations, and we do that by > > mapping content markup patterns to presentation markup templates. That > > said, we could easily define a "presentation context" "abbreviated" and > > then map > > > > units_imperial1#mile to "mi" > > units_time1#hour to "hr" > > (arith1#divide units_imperial1#mile units_time1#hour) to "mph". > > Sorry - I don'tseehow this one works. Let me give you a concrete example for the latter, in our notation definition syntax (see the MKM 2008 paper or http://kwarc.info/publications/papers/KLMMR_NfAD.pdf for details): <notation> <prototype> <!-- the content markup pattern --> <om:OMA> <om:OMS cd="arith1" name="divide"/> <om:OMS cd="units_imperial1" name="mile"/> <om:OMS cd="units_time1" name="hour"/> </om:OMA> </prototype> <rendering> <!-- the presentation markup template --> <m:mo>mph</m:mo> </rendering> </notation> (The other mappings are easier: just mapping one OMS to one mo.) Now assume the content markup (abbreviated in Lisp style) (arith1#times 1 (arith1#divide units_imperial1#mile units_time1#hour)) Suppose "times" renders to the "invisible times" symbol. Suppose there is a general notation definition for "divide" (rendering as a/b): This one would be ignored here, as the more specific one given above applies. Then, the content markup would render to "1 invisible-times mph", which is what we want. The additional benefit of this approach is, as I believe, the one can use context-dependent presentation. Think of kilometres per hour, which are rendered as "kph" in English but as "km/h" in other languages. (Is that right?) Cheers, Christoph -- Christoph Lange, Jacobs Univ. Bremen, http://kwarc.info/clange, Skype duke4701
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Om mailing list [email protected] http://openmath.org/mailman/listinfo/om
