Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Lingua::Conjunction 2.00

    Download button

    No screenshots available
    Downloads: 349  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robert Rothenberg | More programs
    Perl Artistic License / FREE
    August 23rd, 2006, 13:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Lingua::Conjunction description

    Lingua::Conjunction is Perl module convert Perl lists into linguistic conjunctions.

    Lingua::Conjunction is Perl module convert Perl lists into linguistic conjunctions.

    SYNOPSIS

    use Lingua::Conjunction;

    # emits "Jack"
    $name_list = conjunction('Jack');

    # emits "Jack and Jill"
    $name_list = conjunction('Jack', 'Jill');

    # emits "Jack, Jill, and Spot"
    $name_list = conjunction('Jack', 'Jill', 'Spot');

    # emits "Jack, a boy; Jill, a girl; and Spot, a dog"
    $name_list = conjunction('Jack, a boy', 'Jill, a girl', 'Spot, a dog');

    # emits "Jacques, un garcon; Jeanne, une fille; et Spot, un chien"
    Lingua::Conjunction->lang('fr');
    $name_list = conjunction(
    'Jacques, un garcon',
    'Jeanne, une fille',
    'Spot, un chien'
    );

    Lingua::Conjunction exports a single subroutine, conjunction, that converts a list into a properly punctuated text string.

    You can cause conjunction to use the connectives of other languages, by calling the appropriate subroutine:

    Lingua::Conjunction->lang('en'); # use 'and' (default)
    Lingua::Conjunction->lang('es'); # use 'y'

    Supported languages in this version are English, Spanish, French, Italian, German, Portuguese, Norwegian, Danish, Dutch, Afrikaans, Swahili, and Latin. (Klingon is intentionally not supported.)

    You can also set connectives individually:

    Lingua::Conjunction->separator("...");
    Lingua::Conjunction->separator_phrase("--");
    Lingua::Conjunction->connector_type("or");

    # emits "Jack... Jill... or Spot"
    $name_list = conjunction('Jack', 'Jill', 'Spot');

    The separator_phrase is used whenever the separator already appears in an item of the list. For example:

    # emits "Doe, a deer; Ray; and Me"
    $name_list = conjunction('Doe, a deer', 'Ray', 'Me');

    You may use the penultimate routine to diable the separator after the next to last item. Generally this is bad English practice but the option is there if you want it:

    # emits "Jack, Jill and Spot"
    Lingua::Conjunction->penultimate(0);
    $name_list = conjunction('Jack', 'Jill', 'Spot');

    I have been told that the penultimate comma is not standard for some languages, such as Norwegian. Hence the defaults set in the %languages.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl module | convert Perl lists | linguistic conjunctions | Lingua::Conjunction | Perl | module

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM