The code I've got so far works pretty well - I've tested it on some medium-sized corpora and the only times the expected result was different from the actual result was when the corpus was wrong. The code works by first checking a few specific rules for numbers and acromyns, then checking against a few exceptional cases (word prefixes), then checking whether the word starts with a vowel. Most of the rules came from some Perl code I found a while a go - just ported them over to Python.
But I agree that this would be far too difficult ( / impossible) to make multi-lingual so is perhaps not appropriate for inclusion in Django. Harry On Jan 6, 2:17 pm, sago <idmilling...@googlemail.com> wrote: > > Hmm, can it handle the following? > > > an honest man > > a history book > > an historical book (debatable) > > It can't, the rules for the indefinite article around 'h' are complex > and depend on the etymology of the word used. To add complexity the > lexicographic rules are often different to the rules for speech, and > UK rules differ from US rules (and possibly Oz too, but I don't > know). > > > If you present some research to > > demonstrate how this tag could/would work for non-English languages, > > it would be a lot more compelling. > > That's not going to work, in any meaningful sense. That peculiarity of > the article is highly English-specific. The generalization would > surely be something like > > {% if /some-regex/.matches(word) %}{{ form1 }} {{ word }}{% else %} > {{ form2 }} {{ word }}{% endif %} > > where the regex is language and context dependent. There are various > regex replacement filters/tags out in the djangosphere. Could you use > one of them? > > > (That's NT Koine Greek, it might be different/simpler/more complicated > > in modern Greek). > > What is it about Django and NT scholars - have you come across James > Tauber (of Pinax fame?) > > Ian.
-- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.