stsc / DateTime-Format-Natural

Parse informal natural language date/time strings
5 stars 5 forks source link

Language module currently limited to EN [rt.cpan.org #62541] #13

Open stsc opened 3 years ago

stsc commented 3 years ago

Migrated from rt.cpan.org#62541 (status was 'open')

Requestors:

From sharyanto@cpan.org on 2010-10-29 06:08:16 :

I'm currently hacking on DateTime::Format::Natural::Lang::ID.

There is a regex check qr!^(?:en)$!i in _init_check() in DateTime/Format/
Natural.pm which prevents loading another language module. Perhaps change 
this to qr!^\w{2}$! or something?

Thanks.

From schubiger@cpan.org on 2010-10-29 15:25:54 :

On Fri Oct 29 02:08:16 2010, SHARYANTO wrote:
> I'm currently hacking on DateTime::Format::Natural::Lang::ID.

As I don't speak Indonesian, I was thinking whether a plugin based
grammar module inclusion would be suitable now.  That ought to be
considered definitely at some point since it probably would increase
maintenance independence and likely bring code enhancements, too.

In order to improve the metadata handling, report the obstacles you
encounter while authoring the Indonesian grammar class.

> There is a regex check qr!^(?:en)$!i in _init_check() in DateTime/Format/
> Natural.pm which prevents loading another language module. Perhaps change 
> this to qr!^\w{2}$! or something? 

This literal change would allow for language codes without an according
grammar module to bypass the validation, but would fail later due to the
module missing.  I'd suggest simply changing it to qr!^(?:en|id)$!i for now.

From sharyanto@cpan.org on 2010-10-29 16:13:24 :

On Fri Oct 29 11:25:54 2010, SCHUBIGER wrote:
> On Fri Oct 29 02:08:16 2010, SHARYANTO wrote:
> > I'm currently hacking on DateTime::Format::Natural::Lang::ID.
> 
> As I don't speak Indonesian, I was thinking whether a plugin based
> grammar module inclusion would be suitable now.  That ought to be
> considered definitely at some point since it probably would increase
> maintenance independence and likely bring code enhancements, too.
> 
> In order to improve the metadata handling, report the obstacles you
> encounter while authoring the Indonesian grammar class.

You're right, I did encounter some difficulties and quite a bit of 
English-ishms (like plural handling, word order, ordinals) as well as 
things like how there doesn't seem to be an easy way to customize 
dayframe, etc.

So much that I abandoned this approach for now.

> > There is a regex check qr!^(?:en)$!i in _init_check() in DateTime/
Format/
> > Natural.pm which prevents loading another language module. Perhaps 
change 
> > this to qr!^\w{2}$! or something? 
> 
> This literal change would allow for language codes without an 
according
> grammar module to bypass the validation, but would fail later due to 
the
> module missing.  I'd suggest simply changing it to qr!^(?:en|id)$!i 
for now.

Please disregard my previous request and do not add the 'id' to the 
regex. Sorry for the noise.

Regards,
Steven