|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
|
|
|
Re: Glossary sorting in JapaneseFurther to the glossary sorting issue in Japanese, we are using the id for glossentry and notice that they DO GET SORTED, but in an arbitrary manner. Is this a fluke, or is there some sort order that is influencing it? What might that be, so that I can edit it?
Thanks Akagi
|
|
|
RE: Glossary sorting in JapaneseActually, the glossentry element already takes a sortas attribute:
http://docbook.org/tdg/en/html/glossentry.html but it appears that the xsls aren't currently using it. You should be able add the Hiragana or Katanakana versions to the sortas on the glossentry and then do this in the templates from glossary.xsl in your customization layer (using the same concat trick from autoidx-kosek.xsl and autoidx-kimber.xsl): <xsl:sort lang="{$language}" select="translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;)"/> Instead of the current: <xsl:sort lang="{$language}" select="translate(glossterm, &lowercase;, &uppercase;)"/> This line appears more than once, so change them all. This is a bug in the xsls, so please log it at sourceforge if it's not there already. I would love to see the kosek and kimber approaches applied to the glossary too for grouping glossterms into glossdivs in the same way indexterms are automatically grouped into indexdivs. Also, I'm surprised by the need to translate all the characters to the same case. Is that really required? David > -----Original Message----- > From: Akagi K [mailto:akobayashi@...] > Sent: Tuesday, December 18, 2007 12:10 PM > To: docbook-apps@... > Subject: Re: [docbook-apps] Glossary sorting in Japanese > > > Further to the glossary sorting issue in Japanese, we are > using the id for glossentry and notice that they DO GET > SORTED, but in an arbitrary manner. > Is this a fluke, or is there some sort order that is > influencing it? What might that be, so that I can edit it? > > Thanks > Akagi > > > Jirka Kosek wrote: > > > > Akagi Kobayashi wrote: > > > >> The Kosek method can be used successfully to sort Hiragana and > >> Katanakana characters (I'm sure). I have added those after the > >> alphabet to the sort list. Attaching the test xml fyi. > > > > I haven't received file, but I would be happy to add it > into standard > > distribution. You can send it to me off-list. > > > >> Before I look into the Kimber method - I have an idea for sorting > >> words in kanji. > >> > >> Could you tell me whether using the glossentry id= link > might work? > >> This is explained in Chapter 16 - Linking to a glossary entry > >> http://www.sagehill.net/docbookxsl/LinkToGlossary.html > >> So the kanji word will be set as the glossterm; and its reading in > >> hiragana will be set as the glossentry id. > > > > You can do this, but stylesheets doesn't support sorting of > glossterms > > based on id values, so you will have to customize stylesheets. > > > > I think that adding sortas attribute to glossterm is the > right solution. > > If time permits we will discuss this request during today's > DocBook TC > > meeting. > > > > -- > > ------------------------------------------------------------------ > > Jirka Kosek e-mail: jirka@... http://xmlguru.cz > > ------------------------------------------------------------------ > > Professional XML consulting and training services > > DocBook customization, custom XSLT/XSL-FO document processing > > ------------------------------------------------------------------ > > OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member > > ------------------------------------------------------------------ > > Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html > > > > > > > > > > -- > View this message in context: > http://www.nabble.com/Re%3A-Glossary-sorting-in-Japanese-tp101 > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: > docbook-apps-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
Re: Glossary sorting in JapaneseDavid Cramer wrote:
> This line appears more than once, so change them all. This is a bug in > the xsls, so please log it at sourceforge if it's not there already. I > would love to see the kosek and kimber approaches applied to the > glossary too for grouping glossterms into glossdivs in the same way > indexterms are automatically grouped into indexdivs. So please file it as a new RFE at sourceforge. > Also, I'm surprised by the need to translate all the characters to the > same case. Is that really required? Definition of &lowercase; and &uppercase; is such it converts accented letters to unaccented ones -- this might be useful when you have foreign terms in English, but for majority of languages you will need something completely different like kosek or kimber method used for indexing. Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@... http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------ |
|
|
RE: Glossary sorting in Japanese> -----Original Message----- > From: Jirka Kosek [mailto:jirka@...] > Sent: Wednesday, December 19, 2007 2:03 AM > To: David Cramer > Cc: Akagi K; docbook-apps@... > Subject: Re: [docbook-apps] Glossary sorting in Japanese > > David Cramer wrote: > > > This line appears more than once, so change them all. This > is a bug in > > the xsls, so please log it at sourceforge if it's not there > already. I > > would love to see the kosek and kimber approaches applied to the > > glossary too for grouping glossterms into glossdivs in the same way > > indexterms are automatically grouped into indexdivs. > > So please file it as a new RFE at sourceforge. Done: http://sourceforge.net/tracker/index.php?func=detail&aid=1854194&group_i d=21935&atid=373750 I went ahead and logged the sortas one too: http://sourceforge.net/tracker/index.php?func=detail&aid=1854199&group_i d=21935&atid=373747 David --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
RE: Glossary sorting in JapaneseA few thoughts on this:
The sortas glossary sorting fix should also work with the fo stylesheets. I did a similar quick fix with Akagi-san a few months ago and it worked well (then I forgot about it entirely, or I would have filed an RFE myself; my bad:). There are a few differences in the way I did this that may be worth considering: - I put the concat(.....) function inside an entity, then used the entity in each occurrence rather than copy all that code. Since this happens in a bunch more places in the fo code, it seemed like the cleanest way to go. - I wrapped the concat(.....) inside a normalize-space function. This may just be belts and suspenders, but it does mean that a stray space in a sortas or glossterm value won't muck things up. Also, it looks like the latest stylesheets assign the lowercase and uppercase entities to a variable of the same name and use that instead. I'm not sure why, but it does mean that the code should probably use $lowercase and $uppercase instead of &uppercase; and &lowercase;. Sorry I didn't file an RFE when this first came up, it would have saved at least a little trouble. Dick Hamilton > -----Original Message----- > From: David Cramer [mailto:dcramer@...] > Sent: Tuesday, December 18, 2007 3:04 PM > To: Akagi K; docbook-apps@... > Subject: RE: [docbook-apps] Glossary sorting in Japanese > > > Actually, the glossentry element already takes a sortas attribute: > http://docbook.org/tdg/en/html/glossentry.html > but it appears that the xsls aren't currently using it. You should be > able add the Hiragana or Katanakana versions to the sortas on the > glossentry and then do this in the templates from glossary.xsl in your > customization layer (using the same concat trick from > autoidx-kosek.xsl > and autoidx-kimber.xsl): > > <xsl:sort lang="{$language}" select="translate(concat(@sortas, > glossterm[not(parent::glossentry/@sortas) or > parent::glossentry/@sortas > = '']), &lowercase;, &uppercase;)"/> > > Instead of the current: > > <xsl:sort lang="{$language}" select="translate(glossterm, &lowercase;, > &uppercase;)"/> > > This line appears more than once, so change them all. This is a bug in > the xsls, so please log it at sourceforge if it's not there already. I > would love to see the kosek and kimber approaches applied to the > glossary too for grouping glossterms into glossdivs in the same way > indexterms are automatically grouped into indexdivs. > > > Also, I'm surprised by the need to translate all the characters to the > same case. Is that really required? > > David > > > -----Original Message----- > > From: Akagi K [mailto:akobayashi@...] > > Sent: Tuesday, December 18, 2007 12:10 PM > > To: docbook-apps@... > > Subject: Re: [docbook-apps] Glossary sorting in Japanese > > > > > > Further to the glossary sorting issue in Japanese, we are > > using the id for glossentry and notice that they DO GET > > SORTED, but in an arbitrary manner. > > Is this a fluke, or is there some sort order that is > > influencing it? What might that be, so that I can edit it? > > > > Thanks > > Akagi > > > > > > Jirka Kosek wrote: > > > > > > Akagi Kobayashi wrote: > > > > > >> The Kosek method can be used successfully to sort Hiragana and > > >> Katanakana characters (I'm sure). I have added those after the > > >> alphabet to the sort list. Attaching the test xml fyi. > > > > > > I haven't received file, but I would be happy to add it > > into standard > > > distribution. You can send it to me off-list. > > > > > >> Before I look into the Kimber method - I have an idea > for sorting > > >> words in kanji. > > >> > > >> Could you tell me whether using the glossentry id= link > > might work? > > >> This is explained in Chapter 16 - Linking to a glossary entry > > >> http://www.sagehill.net/docbookxsl/LinkToGlossary.html > > >> So the kanji word will be set as the glossterm; and its > reading in > > >> hiragana will be set as the glossentry id. > > > > > > You can do this, but stylesheets doesn't support sorting of > > glossterms > > > based on id values, so you will have to customize stylesheets. > > > > > > I think that adding sortas attribute to glossterm is the > > right solution. > > > If time permits we will discuss this request during today's > > DocBook TC > > > meeting. > > > > > > -- > > > ------------------------------------------------------------------ > > > Jirka Kosek e-mail: jirka@... http://xmlguru.cz > > > ------------------------------------------------------------------ > > > Professional XML consulting and training services > > > DocBook customization, custom XSLT/XSL-FO document processing > > > ------------------------------------------------------------------ > > > OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member > > > ------------------------------------------------------------------ > > > Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html > > > > > > > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/Re%3A-Glossary-sorting-in-Japanese-tp101 > 76176p14402503.html > > Sent from the docbook apps mailing list archive at Nabble.com. > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > docbook-apps-unsubscribe@... > > For additional commands, e-mail: > > docbook-apps-help@... > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: > docbook-apps-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
RE: Glossary sorting in JapaneseThanks David for giving me the details. I amended the glossary.xsl as you said (and nothing else) and it sorted the glossary terms according to their sortas attribute set in Hiragana. Wonderful!
FYI, the Katakana terms without the sortas values are sorted to appear before any of the terms with the Hiragana sortas values. Which version of docbook_xsl will the debugged glossary.xsl be in? We are using docbook_xsl_1.72.0 and for the moment we may just replace the glossary.xsl. Many Thanks also to Jirka for enabling this in the first place. Akagi
|
|
|
RE: Glossary sorting in JapaneseI just committed the fixes to svn, so it will be in the next release or
in the snapshot xsls immediately. In addition to the sortas thing, I noticed that it would missort terms where there is leading whitespace (e.g. <glossterm> foo</glossterm>), so I added a normalize-space() to deal with that. David > -----Original Message----- > From: Akagi K [mailto:akobayashi@...] > Sent: Monday, December 31, 2007 10:59 AM > To: docbook-apps@... > Subject: RE: [docbook-apps] Glossary sorting in Japanese > > > Thanks David for giving me the details. I amended the > glossary.xsl as you said (and nothing else) and it sorted the > glossary terms according to their sortas attribute set in > Hiragana. Wonderful! > > FYI, the Katakana terms without the sortas values are sorted > to appear before any of the terms with the Hiragana sortas values. > > Which version of docbook_xsl will the debugged glossary.xsl be in? > We are using docbook_xsl_1.72.0 and for the moment we may > just replace the glossary.xsl. > > Many Thanks also to Jirka for enabling this in the first place. > Akagi > > > David Cramer (Tech Pubs) wrote: > > > > Actually, the glossentry element already takes a sortas attribute: > > http://docbook.org/tdg/en/html/glossentry.html > > but it appears that the xsls aren't currently using it. You > should be > > able add the Hiragana or Katanakana versions to the sortas on the > > glossentry and then do this in the templates from > glossary.xsl in your > > customization layer (using the same concat trick from > > autoidx-kosek.xsl and autoidx-kimber.xsl): > > > > <xsl:sort lang="{$language}" select="translate(concat(@sortas, > > glossterm[not(parent::glossentry/@sortas) or > > parent::glossentry/@sortas = '']), &lowercase;, &uppercase;)"/> > > > > Instead of the current: > > > > <xsl:sort lang="{$language}" select="translate(glossterm, > &lowercase;, > > &uppercase;)"/> > > > > This line appears more than once, so change them all. This > is a bug in > > the xsls, so please log it at sourceforge if it's not there > already. I > > would love to see the kosek and kimber approaches applied to the > > glossary too for grouping glossterms into glossdivs in the same way > > indexterms are automatically grouped into indexdivs. > > > > > > Also, I'm surprised by the need to translate all the > characters to the > > same case. Is that really required? > > > > David > > > >> -----Original Message----- > >> From: Akagi K [mailto:akobayashi@...] > >> Sent: Tuesday, December 18, 2007 12:10 PM > >> To: docbook-apps@... > >> Subject: Re: [docbook-apps] Glossary sorting in Japanese > >> > >> > >> Further to the glossary sorting issue in Japanese, we are > using the > >> id for glossentry and notice that they DO GET SORTED, but in an > >> arbitrary manner. > >> Is this a fluke, or is there some sort order that is > influencing it? > >> What might that be, so that I can edit it? > >> > >> Thanks > >> Akagi > >> > >> > >> Jirka Kosek wrote: > >> > > >> > Akagi Kobayashi wrote: > >> > > >> >> The Kosek method can be used successfully to sort Hiragana and > >> >> Katanakana characters (I'm sure). I have added those after the > >> >> alphabet to the sort list. Attaching the test xml fyi. > >> > > >> > I haven't received file, but I would be happy to add it > >> into standard > >> > distribution. You can send it to me off-list. > >> > > >> >> Before I look into the Kimber method - I have an idea > for sorting > >> >> words in kanji. > >> >> > >> >> Could you tell me whether using the glossentry id= link > >> might work? > >> >> This is explained in Chapter 16 - Linking to a glossary entry > >> >> http://www.sagehill.net/docbookxsl/LinkToGlossary.html > >> >> So the kanji word will be set as the glossterm; and its > reading in > >> >> hiragana will be set as the glossentry id. > >> > > >> > You can do this, but stylesheets doesn't support sorting of > >> glossterms > >> > based on id values, so you will have to customize stylesheets. > >> > > >> > I think that adding sortas attribute to glossterm is the > >> right solution. > >> > If time permits we will discuss this request during today's > >> DocBook TC > >> > meeting. > >> > > >> > -- > >> > > ------------------------------------------------------------------ > >> > Jirka Kosek e-mail: jirka@... http://xmlguru.cz > >> > > ------------------------------------------------------------------ > >> > Professional XML consulting and training services > >> > DocBook customization, custom XSLT/XSL-FO document processing > >> > > ------------------------------------------------------------------ > >> > OASIS DocBook TC member, W3C Invited Expert, > ISO/JTC1/SC34 member > >> > > ------------------------------------------------------------------ > >> > Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html > >> > > >> > > >> > > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Re%3A-Glossary-sorting-in-Japanese-tp101 > > 76176p14402503.html > >> Sent from the docbook apps mailing list archive at Nabble.com. > >> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: > docbook-apps-unsubscribe@... > >> For additional commands, e-mail: > >> docbook-apps-help@... > >> > >> > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > docbook-apps-unsubscribe@... > > For additional commands, e-mail: > > docbook-apps-help@... > > > > > > > > -- > View this message in context: > http://www.nabble.com/Re%3A-Glossary-sorting-in-Japanese-tp101 > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: > docbook-apps-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
| Free embeddable forum powered by Nabble | Forum Help |