(Updated on Friday 3 February 2006 to add valuable source of information given by Richard Ishida)
In the concepts of microformats, there is a key concept which is
design for humans first, machines second. We have often been faced to the problem of giving a date that will be easy to read by human and will be easy to parse by a computer. Or maybe you would like to give the price of a product with values in two currencies? Or you would like to give the translation of a term in another language? How would you be able to do that in XHTML? Is there a simple way of associating different types of information with a simple semantic relationship.
There is a language for these applications which has been created in 2001 at W3C: Ruby Annotation.
Ruby on the Web these days is known to be a programming language, a programmer working for IBM and I guess for most people, everywhere in the world, a red gemstone. In the context of W3C, Ruby is a simple markup language which offers the possibility of creating inline annotations, as described in the Ruby specification
Ruby is the term used for a run of text that is associated with another run of text, referred to as the base text. Ruby text is used to provide a short annotation of the associated base text. It is most often used to provide a reading (pronunciation guide). Ruby annotations are used frequently in Japan in many kinds of publications, including books and magazines. Ruby is also used in China, especially in schoolbooks.
Ruby text is usually presented alongside the base text, using a smaller typeface. The name “ruby” in fact originated from the name of the 5.5pt font size in British printing, which is about half the 10pt font size commonly used for normal text.
You will find a lot of answers to your questions in the FAQ about Ruby.
Use Cases for Ruby Annotation
You might want to represent a date and give information about the different parts of the date on a package to be sure that no mistakes will be made.
- Ruby base: Thursday 2 2 2006
- Explanations: This is an expiration date with the following sequence: a day name, the day, the month and the year.
In Japan, when you learn the language, you may need to give the sound equivalent of the words in a specific scripting system, so readers will be able to pronounce it.
- Base text: “??”
- Ruby as pronounciation description with Hiragana “???”, Katakana “???” or Romaji “nihon”
How to write it?
<p><ruby> <rb>日本</rb> <rt>nihon</rt> </ruby></p>
In a similar way for chinese language.
- Base text: ?
- Ruby as pronunciation description with pin-yin “hao”
Linguistic morphological glossing
You might want to explain in a sentence which part is a noun and which part is a verb. For example, at school, when you teach grammar to children.
- Base text: “I like fish”
- Ruby as morphological glossing: Noun (for “I”) Verb (for “like”) Noun (for “fish”)
Expression of “invisible” units in a text
The base text contains a Japanese sentence “Yesterday I went to Shibuya”. The pronoun “I” is usually omitted in the original, which makes it hard to understand for e.g. beginning Japanese language learners.
The ruby text above the base text explains what is omitted. The first ruby text line below the base text contains a romanized vesion. The second ruby text line below the base text contains morpho-lexical information. The abbreviations: “TM” means “topic marker”, “DM” means “direction marker”.
Adding information about gestures to conversation transcriptions
- Base text: “And we bought a biiiig icecream.”
- Ruby can be used to mark up “biiig” and to add information about gestures. It could be for example an image of someone making the gesture and big eyes.
Expressing non-segmentable word boundaries
This is useful for
- a contraction (Old High German, English, many other languages)
- a compound word (Sanskrit, Avestan, many other languages)
- a group of words whose forms have been affected by “euphonic” sandhi changes (Sanskrit, Breton)
- a group of words in which, for orthographic or other reasons, the word junctions are not indicated (Sanskrit, Japanese)
An ex