From: jerome <rom...@ya...> - 2010-03-26 14:31:43
|
I know how to get : fr_FR.utf8 RESULT: slash-dates: 240 dates ok, 0 failed. partial date: 576 dates ok, 0 failed. Non-gregorian: 1216 dates ok, 0 failed. B. C. E.: 144 dates ok, 0 failed. basic test: 8088 dates ok, 0 failed. :) but I do not know why ... :\ According systems we have differents results on date formats by using MON (short months). So, to add this line on Date_fr.py : month_to_int = DateParser.month_to_int # Short months month_to_int[u"janv"] = 1 month_to_int[u"févr"] = 2 month_to_int[u"mars"] = 3 month_to_int[u"avril"] = 4 month_to_int[u"mai"] = 5 month_to_int[u"juin"] = 6 month_to_int[u"juil"] = 7 month_to_int[u"août"] = 8 month_to_int[u"sept"] = 9 month_to_int[u"oct"] = 10 month_to_int[u"nov"] = 11 month_to_int[u"déc"] = 12 will pass with success all tests :) Does it mean that we should also add localized short months ? If I correctly understand, user who writes short months into in his native language will set a textual date. Nothing is lost, date object will not be used for computing age or so. And this returns failures on date_test.py. Right ? Jérôme --- En date de : Ven 26.3.10, jerome <rom...@ya...> a écrit : > De: jerome <rom...@ya...> > Objet: Re: [Gramps-devel] Date parser changed branch/trunk > À: "Benny Malengier" <ben...@gm...> > Cc: gra...@li... > Date: Vendredi 26 mars 2010, 14h30 > Does something has been improved or > modified on main way (DateParser/DateDisplay) for > managing/displaying/parsing "MON day, year" date format ? > > It seems that Date_fr does not properly display few > specific Dates into one Date format : MON Day, year (short > months and comma after the day). I do not see any error with > short months without comma or a dot. > > Note, also minor errors on Date_nl, Date_es, Date_hr, > Date_de > No errors on Date_pt > I cannot test Date_sv !!! > > Nevertheless, this should be related on regex into > localized date handlers and often very rare cases (not the > common date format :calendar, quality, etc ...). One space, > dot or end of line characters might fix all failures ! > > > Regards, > Jérôme > > > > --- En date de : Ven 26.3.10, jerome <rom...@ya...> > a écrit : > > > De: jerome <rom...@ya...> > > Objet: Re: [Gramps-devel] Date parser changed > branch/trunk > > À: "Benny Malengier" <ben...@gm...> > > Cc: gra...@li... > > Date: Vendredi 26 mars 2010, 12h20 > > >fr.FR.utf8 > > > slash-dates: 186 dates > > ok, 54 failed. > > > partial date: 486 dates > > ok, 90 failed. > > >Non-gregorian: 1180 dates ok, 36 > > failed. > > > B. C. E.: 126 > > dates ok, 18 failed. > > > basic test: 5928 dates > > ok, 2160 failed. > > > > Note, I get better results under OpenSuse 10.3 ... ;) > > > > slash-dates: 240 dates ok, 0 > > failed. > > partial date: 576 dates ok, > > 0 failed. > > Non-gregorian: 1204 dates ok, 12 > > failed. > > B. C. E.: 144 > > dates ok, 0 failed. > > basic test: 6504 dates ok, > > 1584 failed. > > > > and no crash with en_NG.utf8 (known bug under Ubuntu) > > > > Parsing is also related to distributions > (system/locales) > > "failed" does not mean a crash or lost data, maybe > more > > related to GrampsLocale module than DateParser.py. > > > > We do not need to worry about "failed parsing", this > often > > leads to minor display error. > > Maybe just crash might be annoying for Gramps. > > i.e under Ubuntu : LANG=en.NG.utf8 python gramps.py > > > > > > Jérôime > > > > --- En date de : Ven 26.3.10, jerome <rom...@ya...> > > a écrit : > > > > > De: jerome <rom...@ya...> > > > Objet: Re: [Gramps-devel] Date parser changed > > branch/trunk > > > À: "Benny Malengier" <ben...@gm...> > > > Cc: gra...@li... > > > Date: Vendredi 26 mars 2010, 11h41 > > > Hello, > > > > > > > > > I tried to re-use old testing scripts [1] and I > get > > errors > > > > > > between MOD_TEXTONLY and QUAL_CALCULATED or a > > non-gregorian > > > calendar issue : > > > > > > input was: > > > calendar: CAL_JULIAN > > > modifier: MOD_NONE > > > quality: QUAL_NONE > > > dateval: (4, 1, 1789, False) > > > text: 'Comment. Format: DAY MON YEAR' > > > DateDisplay gives: '4. janv 1789 (Julien)' > > > parsed date was: > > > calendar: CAL_GREGORIAN > > > modifier: MOD_TEXTONLY > > > quality: QUAL_NONE > > > dateval: (0, 0, 0, False) > > > text: '4. janv 1789' > > > this gives:'4. janv 1789' > > > > > > input was: > > > calendar: CAL_JULIAN > > > modifier: MOD_NONE > > > quality: QUAL_NONE > > > dateval: (4, 2, 1789, False) > > > text: 'Comment. Format: DAY MON YEAR' > > > DateDisplay gives: '4. févr 1789 (Julien)' > > > parsed date was: > > > calendar: CAL_GREGORIAN > > > modifier: MOD_TEXTONLY > > > quality: QUAL_NONE > > > dateval: (0, 0, 0, False) > > > text: '4. févr 1789' > > > this gives:'4. févr 1789' > > > > > > Some years ago (other distribution), I was able > to fix > > most > > > of parsing errors on Date_fr.py. > > > Today, I do not know if this is related to last > > changes (or > > > other distribution), but Date_fr.py does > > > not properly parse all dates ... > > > > > > fr_LU.utf8 > > > slash-dates: 180 dates ok, > > > 0 failed. > > > partial date: 432 dates ok, > > > 0 failed. > > > Non-gregorian: 904 dates ok, > > > 8 failed. > > > B. C. E.: 108 > > > dates ok, 0 failed. > > > basic test: 5010 dates ok, > > > 1056 failed. > > > > > > fr_BE.utf8, fr.CA.utf8, fr_CH.utf8 > > > slash-dates: 240 dates ok, > > > 0 failed. > > > partial date: 576 dates ok, > > > 0 failed. > > > Non-gregorian: 1204 dates ok, 12 > > > failed. > > > B. C. E.: 144 > > > dates ok, 0 failed. > > > basic test: 6504 dates ok, > > > 1584 failed. > > > > > > fr.FR.utf8 > > > slash-dates: 186 dates > > > ok, 54 failed. > > > partial date: 486 dates > > > ok, 90 failed. > > > Non-gregorian: 1180 dates ok, 36 > > > failed. > > > B. C. E.: 126 > > > dates ok, 18 failed. > > > basic test: 5928 dates ok, > > > 2160 failed. > > > > > > The difficulty is to get no errors on all > locales > > using > > > french date handler. > > > > > > > > > == others results (availables locales on my > > system)=== > > > > > > LANG=.. python date_test.py > > > > > > en_AU.utf8, en_BW.utf8, en_CA.utf8, en_DK.utf8, > > > en_GB.utf8, > > > en_IE.utf8, en_NZ.utf8, en_US.utf8, en_ZA.utf8, > > en_ZW.utf8 > > > slash-dates: 180 dates ok, > > > 0 failed. > > > partial date: 432 dates ok, > > > 0 failed. > > > Non-gregorian: 912 dates ok, > > > 0 failed. > > > B. C. E.: 108 > > > dates ok, 0 failed. > > > basic test: 6066 dates ok, > > > 0 failed. > > > > > > en_HK.utf8, en_IN, en_PH.utf8, en_SG.utf8 > > > > > > slash-dates: 168 dates > > > ok, 12 failed. > > > partial date: 378 dates > > > ok, 54 failed. > > > Non-gregorian: 882 dates > > > ok, 30 failed. > > > B. C. E.: 90 dates > > > ok, 18 failed. > > > basic test: 5058 dates ok, > > > 1008 failed. > > > > > > en_NG > > > > > > Traceback (most recent call last): > > > File "date_test.py", line 49, in > <module> > > > import DateHandler > > > File "src/DateHandler/__init__.py", line 28, > in > > > <module> > > > from _DateHandler import (LANG, > LANG_SHORT, > > > LANG_TO_PARSER, LANG_TO_DISPLAY, > > > File "src/DateHandler/_DateHandler.py", line > 56, > > in > > > <module> > > > LANG = locale.getlocale(locale.LC_TIME)[0] > > > File "/usr/lib/python2.6/locale.py", line 497, > in > > > getlocale > > > return _parse_localename(localename) > > > File "/usr/lib/python2.6/locale.py", line 410, > in > > > _parse_localename > > > raise ValueError, 'unknown locale: %s' % > > > localename > > > > > > > > > [1] http://gramps.svn.sourceforge.net/viewvc/gramps/branches/maintenance/gramps22/test/dates.sh > > > http://gramps.svn.sourceforge.net/viewvc/gramps/branches/maintenance/gramps22/src/date_test.py > > > (rename relLib to gen.lib) and put the file under > /src > > and > > > play with LANG variable. > > > > > > > > > Regards, > > > Jérôme > > > > > > > > > _______________________________________________ > > > > > > Gramps-devel mailing list > > > > > > Gra...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Download Intel® Parallel Studio Eval > > > Try the new software tools for yourself. Speed > > compiling, > > > find bugs > > > proactively, and fine-tune applications for > parallel > > > performance. > > > See why Intel Parallel Studio got high marks > during > > beta. > > > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > > > Gramps-devel mailing list > > > Gra...@li... > > > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > Download Intel® Parallel Studio Eval > > Try the new software tools for yourself. Speed > compiling, > > find bugs > > proactively, and fine-tune applications for parallel > > performance. > > See why Intel Parallel Studio got high marks during > beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > Gramps-devel mailing list > > Gra...@li... > > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, > find bugs > proactively, and fine-tune applications for parallel > performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > |