if (word(2 $loadinfo()) != [pf]) { load -pf $word(1 $loadinfo()); return; }; # Copyright (c) 2004 BlackJac@EFNet # # Version: 1.1.2005.03.04.1 # # This script will return the singular or plural form of a word given # to it based on the numeric value given to it. # # Available types are: "are", "es", "has", "ies", "was", or # # For example, with type "has", $plural(1 has) returns "has" but $plural(5 has) # returns "have". If no type is specified, either nothing or "s" will be # returned, depending on the value. package plural; alias plural (value, type default "*", void) { if (@value && type) { switch ($type) { (are) (is) { return ${value == 1 ? [is] : [are]}; }; (es) { return ${value == 1 ? [] : [es]}; }; (has) (have) { return ${value == 1 ? [has] : [have]}; }; (ies) (y) { return ${value == 1 ? [y] : [ies]}; }; (was) (were) { return ${value == 1 ? [was] : [were]}; }; (*) (s) { return ${value == 1 ? [] : [s]}; }; }; }; };