GSoC 2010 – week summary: July 26th – August 1st

I started this week with various code improvements / cleaning (r4910). Then I moved the formatting functionality from classes NumbersReader and DatesReader to NumberFormatter and DatetimeFormatter accordingly (r4913, r4920). I didn’t do this earlier as I wanted to encapsulate all CLDR-specific code in Readers, but when I started to work on Parsers it came obvious that with this policy the Readers classes will be pretty fat. So now Readers can read and parse particular CLDR data, while Formatters and Parses uses Readers' API for formatting / parsing (they use parsed number / datetime format patterns, to be precise).

This week was full of frequent, small commits (two more I didn’t mention: r4916, r4922). But the most important task was the lenient parsing (NumberParser: r4925, DatetimeParser: 4928).

This is not a full featured lenient parsing as described in some documents on the Internet, it’s rather a “light” variant. But I’m pretty happy with results and I think that both strict and lenient mode complements each other nicely. Strict parsing is meant to be used when pattern needs to be matched exactly (even whitespace counts :-) ), while lenient parsing ignores everything that can be ignored in order to extract important elements from the string.

I rewrote the tests for parsers in order to test both parsing modes thoroughly. You can see in these tests that when strict mode fails and returns FALSE, lenient mode does just fine :-).

I gathered significant list of various code-cleaning tasks in my FLOW3 TODO file ;-), so I plan to review my code extensively next week. I will also implement some Validators for FLOW3 Validation subsystem (they will use NumberParser and DatetimeParser to do the job).

Tags: ,

blog comments powered by Disqus