Subject: Re: [htdig3-dev] Simple Patch on PLURAL_MATCHES for 3.1.4
From: Gilles Detillieux (firstname.lastname@example.org)
Date: Thu Jan 20 2000 - 10:34:05 PST
According to Jerome ALET:
> that's why I think my approach is more general. I really think that all
> this (not only pluralization) should be managed by the locales, and have
> nothing to do with htdig which should only use the correct (future) locale
> functions to solve the internationalization problem. I understand this is
> not really part of the htdig project, but this would be great for htdig
> and for a lot of other applications.
> what you wrote make me think: couldn't ispell and associated tools help
> us, ispell dependency and speed problem apart ? AFAIK ispell knows
> different forms for same words, e.g.: write wrote written are three
> different forms of the same verb. (I must say I've never used ispell, but
> I think it does).
Let's keep in mind that this whole thread started because of one simple
template variable, which is used to pluralise one single word in a template
when there's more than one matched document. And it isn't even used in
the default templates. The note in attrs.html reads:
If MATCHES is not 1, this will be the string "s", else it is an
empty string. This can be used to say something like "$(MATCHES)
document$(PLURAL_MATCHES) were found"
The current approach doesn't even work in English if the word to be
pluralised is "match", which requires an "es" suffix.
But we're still pluralising only one word, so I don't think a general
international pluralisation algorithm is called for. If we're going
to the trouble of adding elaborate algorithms to htsearch, that energy
might be better spent implementing a template variable expression parser,
for things like $($(MATCHES)>1?"es":""). Either way, it's not going to
happen anytime soon.
I think Jesse is on the right track that the best solution would be to
provide both singular and plural endings, or the entire word for both.
If the idea of two additional attributes doesn't appeal to anyone, an
alternative would be to allow a second, optional string on the proposed
plural_suffix attribute, to give the suffix for the singular form if
the word to be pluralised in the template needs it. So, depending on
the word, you could use:
plural_suffix: e a
plural_suffix: e o
plural_suffix: i us
and the word in the template would contain the root without the suffix.
This should work fine as long as you don't need to pluralise several
words of differing genders or with different pluralisation rules, which
would be pretty unlikely to happen on a page of search results.
-- Gilles R. Detillieux E-mail: <email@example.com> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil Dept. Physiology, U. of Manitoba Phone: (204)789-3766 Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to firstname.lastname@example.org You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Thu Jan 20 2000 - 10:34:54 PST