Changeset 293 for trunk/plugins/en/complex_want_catch.tcl
- Timestamp:
- 09/22/03 09:46:05 (9 years ago)
- File:
-
- 1 edited
-
trunk/plugins/en/complex_want_catch.tcl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/en/complex_want_catch.tcl
r292 r293 1 1 ## bMotion plugin: want catcher 2 # 3 # Jolly sneaky.. if someone wants something, we'll remember it for ourselves :) 4 # 5 # $Id$ 2 6 3 # 7 4 8 ############################################################################### 9 # This is a bMotion plugin 10 # Copyright (C) James Michael Seward 2000-2002 5 # Jolly sneaky.. if someone wants something, we'll remember it for ourselves :) 6 11 7 # 12 # This program is covered by the GPL, please refer the to LICENCE file in the 13 # distribution; further information can be found in the headers of the scripts 14 # in the modules directory. 8 9 # $Id$ 10 11 # 12 13 14 15 15 ############################################################################### 16 16 17 # This is a bMotion plugin 18 19 # Copyright (C) James Michael Seward 2000-2002 20 21 # 22 23 # This program is covered by the GPL, please refer the to LICENCE file in the 24 25 # distribution; further information can be found in the headers of the scripts 26 27 # in the modules directory. 28 29 ############################################################################### 30 31 32 17 33 bMotion_plugin_add_complex "want-catch" "i (want|need) (.+)" 100 bMotion_plugin_complex_want_catcher "en" 34 18 35 bMotion_plugin_add_complex "mmm-catch" "^mmm+ (.+)" 100 bMotion_plugin_complex_mmm_catcher "en" 36 19 37 bMotion_plugin_add_complex "noun-catch" {[[:<:]](?:a|an|the) ([[:alpha:]]+)} 100 bMotion_plugin_complex_noun_catcher "en" 20 38 39 21 40 proc bMotion_plugin_complex_want_catcher { nick host handle channel text } { 41 22 42 if [regexp -nocase "i (want|need) (?!to)(.+? )" $text matches verb item] { 43 23 44 #that's a negative lookahead ---^ 45 24 46 bMotion_flood_undo $nick 47 25 48 bMotion_abstract_add "sillyThings" $item 26 49 } 50 27 51 } 28 52 53 29 54 proc bMotion_plugin_complex_mmm_catcher { nick host handle channel text } { 55 30 56 if [regexp -nocase "^mmm+ (.+?) " $text matches item] { 57 31 58 bMotion_flood_undo $nick 59 32 60 bMotion_abstract_add "sillyThings" $item 33 61 } 62 34 63 } 35 64 65 66 36 67 proc bMotion_plugin_complex_noun_catcher { nick host handle channel text } { 37 if [regexp -nocase {[[:<:]](a|an|the|some) ([[:alpha:]]+(?!ed|ing|ce|ly))} $text matches prefix item] { 68 69 if [regexp -nocase {[[:<:]](a|an|the|some) ([[:alpha:]]+)( [[:alpha:]]+[[:>:]])?} $text matches prefix item second] { 70 38 71 bMotion_flood_undo $nick 72 39 73 set item [string tolower $item] 74 75 if [regexp "(ly)$" $item] { 76 return 0 77 } 78 79 if [regexp "(ing|ed)$" $item] { 80 if {$second == ""} { 81 return 0 82 } 83 append item $second 84 } 85 40 86 set prefix [string tolower $prefix] 41 87 if {$prefix == "the"} {
Note: See TracChangeset
for help on using the changeset viewer.
