Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Module Namespace, CPAN, and Linguistics

by Polyglot (Pilgrim)
on May 19, 2009 at 04:36 UTC ( #764825=perlmeditation: print w/replies, xml ) Need Help??

I'm putting together some routines for identifying characteristics of the Thai alphabet, making useful character classes, and may include some other nice features such as word splitting and/or sorting. I hope to package a module for CPAN from these, for the benefit of the Thai community.

CPAN recommends discussion regarding the NAMESPACE for each module, and I thought some of the monks here might have wisdom in this area.

If you see a module for a language, for example if a module were called "Swahili," what would you expect it to contain? For a rare language, will such a broad and generic name become "namespace pollution" later on? What about "Thai" vs "Thai::CharClass" etc.?

Perhaps many languages do not have modules named after them. Should I be looking instead at something like "Lingua::Thai::CharClass"? or does this seem like it gets too unwieldy?

Last but not least, if a previously created module (such as Lingua) becomes the base of the new namespace/module, does this mean that the developers would need to work together to accommodate the name? Since I have never created a module before, this is unclear to me...would I send the module to the authors of Lingua, for example, to be included in their package?

Thank you for your patience with this neophyte.



  • Comment on Module Namespace, CPAN, and Linguistics

Replies are listed 'Best First'.
Re: Module Namespace, CPAN, and Linguistics
by Your Mother (Chancellor) on May 19, 2009 at 04:53 UTC

    You might also consider Lingua::CharClass::Thai, especially if you can get a generalized Lingua::CharClass piece which either sets some baseline functions for subclassing or contains no code but Pod for how to do new CharClasses so other authors can jump in and keep a uniform interface. I suggest keeping to the ISO abbreviation for Thai, so Lingua::TH::CharClass or Lingua::CharClass::TH.

Re: Module Namespace, CPAN, and Linguistics
by JavaFan (Canon) on May 19, 2009 at 12:19 UTC
    CPAN has Parse::RandGen::CharClass, CharClass::Matcher, and Regexp::CharClasses. Perhaps you can build on one of those namespaces (although I have to say, I haven't checked what those modules do)? Or you could send a patch if one of the modules fits, or perhaps a patch for one of the existing Lingua modules.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://764825]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-01-19 20:24 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (222 votes). Check out past polls.