brunolojor / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

Improvement : add tags with accents #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When you want to add a new tag, it may be disappointing to have to enter
every accents.

Example : [tag] Céline
If you enter C-E-L or C-e-l or c-e-l, the system won't propose Céline
because of the accent. It is very disappointing when you use accents on
capitals, for example with the Édouard

Here is a way to modify commongtk.py to solve this issue

> add : import unicodedata at the beginning of the file
> modify the function feed(self,l,s) :

    def feed(self,l,s): # filter with begginning of 't'
        l.clear()
        s=unicode(s).upper()
        s=unicodedata.normalize('NFD',s)
        s=s.encode('ascii','ignore')
        for t,c in self.liste:
            u=unicode(t).upper()
            u=unicodedata.normalize('NFD',u)
            u=u.encode('ascii','ignore')
            if u.upper().startswith(s):
                l.append( (t,"(%s)"%c) )

It Works for me!

Original issue reported on code.google.com by gautier....@gmail.com on 8 Jan 2009 at 6:23

GoogleCodeExporter commented 9 years ago
Improvment accepted ... in rev 141
thanks gautier, it's better !

Original comment by manat...@gmail.com on 8 Jan 2009 at 10:27