pike.git / lib / modules / String.pmod / Elite.pmod

version» Context lines:

pike.git/lib/modules/String.pmod/Elite.pmod:163:    "X":"÷"/1,    "Y":"Ýÿ¥"/1,   ]);      //! Translates one word to 1337. The optional   //! argument leetp is the maximum percentage of   //! leetness (100=max leet, 0=no leet).   //! elite_word only do character-based translation,   //! for instance from "k" to "|<", but no language   //! translation (no "cool" to "kewl"). - string elite_word(string in, void|int(0..100) leetp, void|int(0..2) eightbit) + string elite_word(string in, int(0..100) leetp=50, int(0..2) eightbit=0)   { -  if (undefinedp(leetp)) leetp=50; // aim for 50% leetness -  else if (!leetp) +  if (!leetp)    return replace(in,"\1001\1002\1003"/1,"fpl"/1);       array v;    switch (eightbit)    {    case 0:    v=rows(elite_char,    lower_case(in)/1);    break;    case 2:
pike.git/lib/modules/String.pmod/Elite.pmod:238:      //! Translates a string to 1337. The optional   //! argument leetp is the maximum percentage of   //! leetness (100=max leet, 0=no leet).   //!   //! The translation is performed in three steps,   //! first the necessary elite translations (picture -> pic,   //! cool->kewl etc), then optional translations   //! (ok->k, dude->dood, -ers -> -orz), then   //! calls elite_word on the resulting words. - string elite_string(string in, void|int(0..100) leetp, void|int(0..1) eightbit) + string elite_string(string in, int(0..100) leetp=50, int(0..1) eightbit=0)   { -  if (undefinedp(leetp)) leetp=50; // aim for 50% leetness -  +     in=" "+in+" ";    foreach (elite_short;;[string what,array(string)|string dest])    {    string res="";    int i;    while ((i=search(lower_case(in),what))!=-1)    {    if (arrayp(dest)) dest=dest[random(sizeof(dest))];    res+=in[..i-1]+dest;    in=in[i+sizeof(what)..];