Using SOLID to convert to one-ps-per-sense format

Author John Hatton | 27.06.2009 | Category FLEx, Dictionary, Solid

This week saw another colleague here in Papua New Guinea deciding to move his Toolbox dictionary to FLEx.  He had a fair amount of entries like this:

\lx ba
\ps n
\sn 1
\ge brother-in-law
\de brother-in-law: reciprocal term between wife’s father’s brother’s children and father’s brother’s daughter’s husband
\sn 2
\ge brother-in-law
\de brother-in-law: reciprocal term between sister’s husband and wife’s siblings
\sn 3
\ge in-law
\de reciprocal term between father’s sister’s husband and wife’s brother’s child
\dt 18/Sep/2000

These are all nouns, and he identifies this just once, at the top of the entry.  That counts as good MDF.  The problem is, FLEx import doesn’t handle this situation.  In fact, a recent import I did left us with over 60 cases where the \ps was turned into its own sense, followed by all the actual senses which were left with no grammatical category. Neither I nor my colleague caught this until she had already been working in WeSay on the new data for too long to go back and repeat the import. Yuck.

To prevent this, we need to move that \ps down to under the \sn, and then copy it for all remaining senses which lack a \ps.  As of SOLID version 0.9.319, we can now do this:

image

As with all these quickfixes, I use TortoiseHG (mercurial) so that I can look at exactly what changed, verifying that nothing was messed up. Here’s what quickfix did to the above record, as seen from TortoiseHg’s Commit tool:

2009-06-27_09-52-06-134

WeSay: What’s it all about

Author cambell | 13.03.2009 | Category Dictionary, WeSay

To celebrate the opening of the new Linguistics Institute at Payap University the Palaso team made a video.  It’s a fun introduction to ‘WeSay’ our dictionary making software.

Formatting dictionaries with CSS

Author Eric Albright | 26.02.2008 | Category Typesetting, Dictionary, Developers

In evaluating CSS as a stylesheet language for formatting dictionaries, I started putting PrinceXML through its paces. I tried what I considered to be Cobuild dictionarythe hardest dictionary layout and while I think I have matched many of the features. The sidenotes are just not going to happen without specialized support for them in CSS. (The closest I could get was a float but of course if you have more than one within a line, they just write on top of each other). That result is here. I then switched to a more typical layout which had no problems at all. That result is here. You can get all the files to reproduce this exercise here.

Types of style

There are really a number items which contribute to the style of a dictionary:
  1. Selection of fields
  2. Order of fields
  3. Textual markup - characters or text that is added before, after, or around items to distinguish a field from surrounding text
  4. Character styles - font changes
  5. Paragraph styles
  6. Page layout - columns
CSS actually allows us to handle items 1, 3-5. (Selection of fields can be handled by setting the display property to none.) All the textual markup in the examples was done using the CSS content property.

CSS3 Selectors

Another interesting behavior of CSS 3 is that you cannot select the first element having a class containing the word ‘pronunciation’: .pronunciation:first-of-type You can only use the :first-of-type selector to select the first element with a particular name so a general div and span with class attributes would have to be converted to xml named elements instead. There is a way around this, given that our document will be generated from another format and that is to actually add classes first-of-type and last-of-type. Then the data becomes:

<span class="pronunciation first-of-type">...</span><span class="pronunciation">...</span><span class="pronunciation last-of-type">...</span>

and

<span class="pronunciation first-of-type last-of-type">...</span>

Playing with both the xml and xhtml varieties in IE7 and Firefox 2 shows that both do a much better job with the xhtml over xml.

Column-span

The only other problem I ran into was that Prince does not yet support the column-span property. This ended up not being a big problem since I just wanted the heading to span both columns and was able to work around this by making the first page of the section have a 12cm top margin and to float the heading into this space.