Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: natural language sentence construction

by dimmesdale (Friar)
on Jun 17, 2001 at 20:10 UTC ( #89175=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $i (0..$#$types) {
        if ($i && $i == $#$types) {
    ...
        } elsif ($i) {
                    $sentence .= ', ';
                }
    
  2. or download this
    for(@$types) {
        if($_ eq $types->[-1]) {
            $sentence .= $matches>1 ? ' and ' : ' or '
        } else { $sentence .= ', ' }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://89175]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-09-22 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (206 votes), past polls