Ignore:
Timestamp:
08/26/10 11:32:47 (21 months ago)
Author:
james
Message:

reduced lolcats chance
added output to "and then"
trigger fixes for r, luggage combination and look robot
fix priority on typos plugin
new "triplet" macro filter which gets a const-vowel-const triplet from the word
new "pretriplet" macro filter to use with "triplet"
fixed output_append to actually fire
make "cool" a stopwor for spoonerism
more grammar nazism
fix broken output being sent to IRC
adjust lower friendship limit slightly
many updates to abstracts
fix queue not adding last output to cache
guard code in interbot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/en/output_VAR.tcl

    r1053 r1082  
    110110                                        set replacement [bMotion_plugins_settings_get "output:VAR" "last" $channel "$abstract"] 
    111111                                } 
     112                                "prevtriplet" { 
     113                                        set replacement [bMotion_plugins_settings_get "output:VAR" "last:pretriplet" $channel $abstract] 
     114                                } 
    112115                                "strip" { 
    113116                                        set replacement [bMotion_strip_article $replacement] 
     
    139142                                        set replacement [string toupper $replacement] 
    140143                                } 
     144                                "triplet" { 
     145                                        bMotion_plugins_settings_set "output:VAR" "last:pretriplet" $channel $abstract $replacement 
     146                                        set temp [bMotion_find_triplet $replacement] 
     147                                        if {$temp == ""} { 
     148                                                putlog "triplet is blank" 
     149                                                return "" 
     150                                        } 
     151                                        set replacement $temp 
     152                                } 
     153                                         
    141154                        } 
    142155                        bMotion_putloglev 1 * "current replacement is $replacement" 
     
    160173} 
    161174 
     175proc bMotion_find_triplet { word } { 
     176  set start 0 
     177        if {[string length $word] < 3} { 
     178                return "" 
     179        } 
     180 
     181        set results [list] 
     182 
     183        while {[regexp -start $start -nocase -indices {([^aeiou ][aeiou][^aeiou ])} $word matches a]} { 
     184                lappend results [string range $word [lindex $a 0] [lindex $a 1]] 
     185                set start [lindex $a 1] 
     186        } 
     187 
     188        if {[llength $results] == 0} { 
     189                return "" 
     190        } 
     191 
     192        return [pickRandom $results] 
     193} 
    162194 
    163195bMotion_plugin_add_output "VAR" bMotion_plugin_output_VAR 1 "en" 3 
Note: See TracChangeset for help on using the changeset viewer.