/[drupal]/contributions/modules/dialectic/dialectic.inc
ViewVC logotype

Diff of /contributions/modules/dialectic/dialectic.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Fri Jun 13 16:39:11 2008 UTC revision 1.2, Sat Oct 24 04:00:45 2009 UTC
# Line 0  Line 1 
1    <?php
2    
3    function dialectic_rot13($text) {
4      return str_rot13($text);
5    }
6    
7    function dialectic_morse($text) {
8      // First strip out things that will cause confusion.
9      $text = preg_replace("/[^a-zA-Z0-9\.!?\,\@\(\)\& ]/", '', trim(strtolower($text)));
10    
11      $lookup = array(
12        ' ' => ' /',
13        '.' => ' .-.-.-',
14        ',' => ' --..--',
15        '?' => ' ..--..',
16        '!' => ' -.-.--',
17        '(' => ' -.--.',
18        ')' => ' -.--.-',
19        '&' => ' . ...',
20        '@' => ' .--.-.',
21        'a' => ' .-',
22        'b' => ' -...',
23        'c' => ' -.-.',
24        'd' => ' -..',
25        'e' => ' .',
26        'f' => ' ..-.',
27        'g' => ' --.',
28        'h' => ' ....',
29        'i' => ' ..',
30        'j' => ' .---',
31        'k' => ' -.-',
32        'l' => ' .-..',
33        'm' => ' --',
34        'n' => ' -.',
35        'o' => ' ---',
36        'p' => ' .--.',
37        'q' => ' --.-',
38        'r' => ' .-.',
39        's' => ' ...',
40        't' => ' -',
41        'u' => ' ..-',
42        'v' => ' ...-',
43        'w' => ' .--',
44        'x' => ' -..-',
45        'y' => ' -.--',
46        'z' => ' --..',
47        '0' => ' -----',
48        '1' => ' .----',
49        '2' => ' ..---',
50        '3' => ' ...--',
51        '4' => ' ....-',
52        '5' => ' .....',
53        '6' => ' -....',
54        '7' => ' --...',
55        '8' => ' ---..',
56        '9' => ' ----.',
57      );
58    
59      $search = array_keys($lookup);
60      $replace = array_values($lookup);
61      return str_replace($search, $replace, $text);
62    }
63    
64    function dialectic_ubby($text) {
65      return preg_replace(array("/([aeiou])/", "/([AEIOU])/"), array("ubb\\1", "UBB\\1"), $text);
66    }
67    
68    function dialectic_pig($text) {
69      $e = explode(' ', $text);
70      $text = '';
71      while (list($n, $w) = each($e)) {
72        if (preg_match("/[a-z0-9]/i", $w)) {
73          if (preg_match("/[b-df-hj-np-tv-z0-9]/i", $w[0])) {
74            $w = tr($w, $i + 1) . $w[$i] . 'ay';
75          }
76          else {
77            $w .= 'ay';
78          }
79        }
80        $w = preg_replace("/([^\,\.]*)([\,\.]*)([b-df-hj-np-tv-z0-9]{0,1}(ay){0,1})/i","\\1\\3\\2", $w);
81        $text .= $w . ' ';
82      }
83      return substr($text, 0, -1);
84    }
85    
86    function dialectic_fudd($text) {
87      $patterns = array(
88        '/[rl]/' => 'w',
89        '/[RL]/' => 'W',
90        '/qu/' => 'qw',
91        '/Qu/' => 'Qw',
92        '/QU/' => 'QW',
93        '/([^ ])th([^aeiouAEIOU])/' => '\\1f\\2',
94        '/([^ ])Th|TH([^aeiouAEIOU])/' => '\\1F\\2',
95        '/ th([aeiou])/' => ' d\\1',
96        '/ Th|TH([aeiouAEIOU])/' => ' D\\1',
97        '/n[\.]/' => 'n, uh-hah-hah-hah.',
98      );
99      $search = array_keys($patterns);
100      $replace = array_values($patterns);
101      return preg_replace($search, $replace, $text);
102    }
103    
104    function dialectic_warez($text) {
105      $text = strtolower($text);
106    
107      $patterns = array(
108        '/\.([^a-z0-9])/' => '!!\\1',
109        '/\?/' => '?!?',
110        '/[\']/' => '"',
111        '/dude/' => 'D00D',
112        '/([^ ])ould/' => '\\1UD',
113        '/([^ ])ough/' => '\\1UF',
114        '/([^ ])augh/' => '\\1AFF',
115        '/([^ ])ile/' => '\\1IEL',
116        '/([^a-z0-9])to([^a-z0-9])/' => '\\1 2 \\2',
117        '/([^a-z0-9])your/' => '\\1UR',
118        '/([^a-z0-9])you/' => '\\1U',
119        '/([^a-z0-9])was/' => '\\1WUZ',
120        '/([^a-z0-9])says/' => '\\1SEZ',
121        '/for|four/' => '4',
122        '/s/' => '5',
123        '/ate/' => '8',
124        '/([^a-z0-9])be/' => '\\1B',
125        '/([^a-z0-9])see/' => '\\1C',
126        '/([^a-z0-9])am/' => '\\1M',
127        '/([^a-z0-9])are/' => '\\1R',
128        '/([^a-z0-9])ex/' => '\\1X',
129        '/([^a-z0-9])why/' => '\\1Y',
130        '/ph/' => 'F',
131        '/ch/' => 'CH',
132        '/([^a-z0-9])c/' => '\\1K',
133        '/ea/' => 'EE',
134        '/and/' => '&',
135        '/([a-z])se([^a-z0-9])/' => '\\1EZ\\2',
136        '/([a-z])es|s([^a-z0-9])/' => '\\1Z\\2',
137        '/([^a-z0-9])s/' => '\\1Y',
138        '/e/' => '3',
139        '/a/' => '4',
140        '/t/' => '+',
141        '/k/' => '|<',
142        '/o/' => '0',
143        '/i/' => '1',
144      );
145      $search = array_keys($patterns);
146      $replace = array_values($patterns);
147      return preg_replace($search, $replace, $text);
148    }
149    
150    function dialectic_pirate($text) {
151      $patterns = array(
152        '%\bmy\b%' => 'me',
153        '%\bboss\b%' => 'admiral',
154        '%\bmanager\b%' => 'admiral',
155        '%\b[Cc]aptain\b%' => "Cap'n",
156        '%\bmyself\b%' => 'meself',
157        '%\byour\b%' => 'yer',
158        '%\byou\b%' => 'ye',
159        '%\bfriend\b%' => 'matey',
160        '%\bfriends\b%' => 'maties',
161        '%\bco[-]?worker\b%' => 'shipmate',
162        '%\bco[-]?workers\b%' => 'shipmates',
163        '%\bearlier\b%' => 'afore',
164        '%\bold\b%' => 'auld',
165        '%\bthe\b%' => "th'",
166        '%\bof\b%' =>  "o'",
167        "%\bdon't\b%" => "dern't",
168        '%\bdo not\b%' => "dern't",
169        '%\bnever\b%' => "ne'er",
170        '%\bever\b%' => "e'er",
171        '%\bover\b%' => "o'er",
172        '%\bYes\b%' => 'Aye',
173        '%\bNo\b%' => 'Nay',
174        "%\bdon't know\b%" => "dinna",
175        "%\bhadn't\b%" => "ha'nae",
176        "%\bdidn't\b%" => "di'nae",
177        "%\bwasn't\b%" => "weren't",
178        "%\bhaven't\b%" => "ha'nae",
179        '%\bfor\b%' => 'fer',
180        '%\bbetween\b%' => 'betwixt',
181        '%\baround\b%' => "aroun'",
182        '%\bto\b%' => "t'",
183        "%\bit's\b%" => "'tis",
184        '%\bwoman\b%' => 'wench',
185        '%\blady\b%' => 'wench',
186        '%\bwife\b%' => 'lady',
187        '%\bgirl\b%' => 'lass',
188        '%\bgirls\b%' => 'lassies',
189        '%\bguy\b%' => 'lubber',
190        '%\bman\b%' => 'lubber',
191        '%\bfellow\b%' => 'lubber',
192        '%\bdude\b%' => 'lubber',
193        '%\bboy\b%' => 'lad',
194        '%\bboys\b%' => 'laddies',
195        '%\bchildren\b%' => 'little sandcrabs',
196        '%\bkids\b%' => 'minnows',
197        '%\bhim\b%' => 'that scurvey dog',
198        '%\bher\b%' => 'that comely wench',
199        '%\bhim\.\b%' => 'that drunken sailor',
200        '%\bHe\b%' => 'The ornery cuss',
201        '%\bShe\b%' => 'The winsome lass',
202        "%\bhe's\b%" => 'he be',
203        "%\bshe's\b%" => 'she be',
204        '%\bwas\b%' => "were bein'",
205        '%\bHey\b%' => 'Avast',
206        '%\bher\.\b%' => 'that lovely lass',
207        '%\bfood\b%' => 'chow',
208        '%\broad\b%' => 'sea',
209        '%\broads\b%' => 'seas',
210        '%\bstreet\b%' => 'river',
211        '%\bstreets\b%' => 'rivers',
212        '%\bhighway\b%' => 'ocean',
213        '%\bhighways\b%' => 'oceans',
214        '%\bcar\b%' => 'boat',
215        '%\bcars\b%' => 'boats',
216        '%\btruck\b%' => 'schooner',
217        '%\btrucks\b%' => 'schooners',
218        '%\bSUV\b%' => 'ship',
219        '%\bairplane\b%' => 'flying machine',
220        '%\bjet\b%' => 'flying machine',
221        '%\bmachine\b%' => 'contraption',
222        '%\bdriving\b%' => 'sailing',
223        '%\bdrive\b%' => 'sail',
224        '/ing\b/' => "in'",
225        '/ings\b/' => "in's",
226        // These next two do cool random substitutions
227        '/(\.\s)/e' => '_dialectic_avast("$0",3)',
228        '/([!\?]\s)/e' => '_dialectic_avast("$0",2)', // Greater chance after exclamation
229      );
230      $search = array_keys($patterns);
231      $replace = array_values($patterns);
232      return preg_replace($search, $replace, $text);
233    }
234    
235    function dialectic_chef($text) {
236        $patterns = array(
237    
238        '%an%' => 'un',
239        '%An%' => 'Un',
240    
241        '%au%' => 'oo',
242        '%Au%' => 'Oo',
243        '%(\w)ew%' => '$1oo',
244        '%(\w)ow%' => '$1oo',
245        '%(\W)o%' => '$1oo',
246        '%(\W)O%' => '$1Oo',
247        '%(\w)u%' => '$1oo',
248        '%(\w)U%' => '$1Oo',
249    
250        '%a(\w)%' => 'e$1',
251        '%A(\w)%' => 'E$1',
252        '%en(\W)%' => 'ee$1',
253    
254        '%(\w)e(\W)%' => '$1e-a$2',
255        '%(\W)e%' => '$1i',
256        '%(\W)E%' => '$1I',
257    
258        '%(\w)f%' => '$1ff',
259    
260        '%(\w)ir%' => '$1ur',
261    
262        '%([a-m])i%' => '$1ee',
263        '%([A-M])i%' => '$1EE',
264    
265        '%(\w)o%' => '$1u',
266        '%the%' => 'zee',
267        '%The%' => 'Zee',
268        '%th(\W)%' => 't$1',
269        '%(\w)tion%' => '$1shun',
270        '%v%' => 'f',
271        '%V%' => 'F',
272        '%w%' => 'v',
273        '%W%' => 'V',
274    
275    
276        '%f{2,}%' => 'ff',
277        '%o{2,}%' => 'oo',
278        '%e{2,}%' => 'ee',
279    
280        '%([\.!\?])\s*(</[^>]+>)?\s*$%' => '$1 Bork Bork Bork!$2',
281      );
282    
283      $search = array_keys($patterns);
284      $replace = array_values($patterns);
285      return preg_replace($search, $replace, $text);
286    }
287    
288    function dialectic_jive($text) {
289      $patterns = array(
290        '%file%' => 'stash',
291        '%send%' => "t'row",
292        '%program%' => 'honky code',
293        '%atlas%' => 'Isaac',
294        '%unix%' => 'slow mo-fo',
295        '%UNIX%' => 'that slow mo-fo',
296        '%takes%' => "snatch'd",
297        '%Mexican%' => 'wet-back',
298        '%Italian%' => 'greaser',
299        '%take%' => 'snatch',
300        "%don't%" => "duzn't",
301        '%jive%' => 'JIBE',
302        '%fool%' => 'honkyfool',
303        '%modem%' => 'doodad',
304        '%e the %' => 'e da damn ',
305        '%a the %' => 'a da damn ',
306        '%t the %' => 't da damn ',
307        '%d the %' => 'd da damn ',
308        '% man %' => ' dude ',
309        '%woman%' => 'mama',
310        '%girl%' => 'goat',
311        '%somethin%' => "sump'n",
312        '% lie %' => ' honky jibe ',
313        '%([a-b]\.)%' => '$1 Sheeeiit.',
314        '%([e-f]\.)%' => '$1 What it is, Mama!',
315        '%([i-j]\.)%' => "$1 Ya' know?",
316        '%([m-n]\.)%' => "$1 'S coo', bro.",
317        '%([q-r]\.)%' => '$1 Ah be baaad...',
318        '%([u-v]\.)%' => '$1 Man!',
319        '%([y-z]\.)%' => '$1 Slap mah fro!',
320        '%Sure%' => "Sho' nuff",
321        '%sure%' => "sho' nuff",
322        '% get      %' => ' git',
323        '%will have%' => "gots'ta",
324        '%will%' => "gots'ta ",
325        '%got to%' => "gots'ta",
326        '%I am%' => "I's gots'ta be",
327        '%am not %' => 'aint ',
328        '%is not %' => 'aint ',
329        '%are not %' => 'aint',
330        '% are your %' => " is yo' ",
331        '% are you  %' => ' you is ',
332        '% hat %' => ' fedora ',
333        '% shoe %' => ' kicker ',
334        "%haven't%" => 'aint',
335        '%have to%' => "gots'ta",
336        '%have%' => "gots'",
337        '% has%' => " gots'ta",
338        '%come over%' => 'mosey on down',
339        '% come %' => ' mosey on down ',
340        '%!%' => '.  Right On!',
341        '%buy       %' => 'steal',
342        '% car %' => ' wheels ',
343        '%drive%' => 'roll',
344        '% eat %' => ' feed da bud ',
345        '% black %' => ' brother ',
346        '% negro %' => ' brother',
347        '%white%' => 'honky',
348        '%nigger%' => ' gentleman ',
349        '%nice%' => "supa' fine",
350        '%person%' => "sucka'",
351        '% thing%' => ' wahtahmellun',
352        '%home%' => 'plantation',
353        '%name%' => 'dojigger',
354        '% path%' => ' alley',
355        '%computer%' => 'clunker',
356        '%or%' => "o'",
357        '%killed%' => 'wasted',
358        '%president%' => 'super-dude',
359        '%prime minister%' => 'super honcho',
360        '%injured%' => 'hosed',
361        '%government%' => "guv'ment",
362        '%knew%' => 'knowed',
363        '%because%' => "a'cuz",
364        '%Because%' => "A'cuz",
365        '%your%' => "yo'",
366        '%Your%' => "Yo'",
367        '%four%' => 'foe',
368        '%got%' => 'gots',
369        '%super%' => 'hella',
370        '%very%' => 'hella',
371        "%aren't%" => "ain't",
372        '%young%' => 'yung',
373        '%you%' => "ya'",
374        '%You%' => "You's",
375        '%first%' => 'fust',
376        '%police%' => 'honky pigs',
377        '% string%' => " chittlin'",
378        '% read%' => ' eyeball',
379        '%write%' => 'scribble',
380        '%th%' => 'd',
381        '%Th%' => 'D',
382        '%ing%' => "in'",
383        '% a %' => ' some ',
384        '% to\s+%' => " t'",
385        '%tion%' => 'shun',
386        '% almost %' => " mos' ",
387        '% from%' => ' fum',
388        '% because %' => " cuz' ",
389        "%you're%" => 'youse',
390        "%You're%" => 'Youse',
391        '%alright%' => "coo'",
392        '%okay%' => "coo'",
393        '%er %' => "a' ",
394        '%known%' => 'knode',
395        '%want%' => "wants'",
396        '%beat%' => "whup'",
397        '%exp%' => "'sp",
398        '%exs%' => "'s",
399        '% exc%' => " 's",
400        '% ex%' => " 'es",
401        '%like%' => 'likes',
402        '%did       %' => 'dun did',
403        '%kind of%' => "kind'a",
404        '%women%' => 'honky chicks',
405        '% men %' => ' dudes ',
406        '% mens %' => ' dudes ',
407        '% man %' => ' dude ',
408        '%woman%' => 'honky chick',
409        '%dead%' => 'wasted',
410        '%good%' => 'baaaad',
411        '%open %' => 'jimmey ',
412        '%opened %' => "jimmey'd ",
413        '% very%' => ' real',
414        '%per%' => "puh'",
415        '%pera%' => "puh'",
416        '%oar%' => "o'",
417        '% can%' => ' kin',
418        '%just %' => 'plum ',
419        '%detroit%' => 'Mo-town',
420        '%western electric%' => "da' cave",
421        '% believe%' => " recon'",
422        '%[Ii]ndianapolis%' => 'Nap-town',
423        '% [Jj]ack%' => ' Buckwheat',
424        '% [Bb]ob %' => " Liva' Lips ",
425        '% [Pp]hil %' => ' dat fine soul ',
426        '% [Mm]ark %' => ' Amos ',
427        '%[Rr]ober%' => 'Leroy',
428        '%[Ss]andy%' => 'dat fine femahnaine ladee',
429        '%[Jj]ohn %' => "Raz'tus ",
430        '% [Pp]aul%' => " Fuh'rina",
431        '%[Rr]eagan%' => 'Kingfish',
432        '%[Dd]avid%' => 'Issac',
433        '%[Rr]onald%' => 'Rolo',
434        '% [Jj]im %' => ' Bo-Jangles ',
435        '% [Mm]ary%' => ' Snow Flake',
436        '%[Ll]arry%' => 'Remus',
437        '%[Jj]oe%' => "Massa' ",
438        '%[Jj]oseph%' => "Massa' ",
439        '%mohammed%' => "liva' lips",
440        '%pontiff%' => "wiz'",
441        '%pope%' => "wiz'",
442        '%pravda%' => 'dat commie rag',
443        '%broken%' => "bugger'd",
444        '%strange %' => 'funky ',
445        '%dance %' => 'boogy ',
446        '% house%' => ' crib',
447        '%ask       %' => "ax'",
448        '% so %' => " so's ",
449        '%head%' => "'haid",
450        '%boss%' => 'main man',
451        '%wife%' => 'mama',
452        '%people%' => "sucka's",
453        '%money%' => "bre'd",
454        '%([a-z]):%' => '$1, dig dis:',
455        '%amateur%' => "begina'",
456        '%radio     %' => "transista'",
457        '% of %' => ' uh ',
458        '%what%' => 'whut',
459        '%does%' => 'duz',
460        '%was%' => 'wuz',
461        '% were%' => ' wuz',
462        '%understand it%' => 'dig it',
463        '%understand%' => 'dig it',
464        '% my%' => " mah'",
465        '% [Ii] %' => " ah' ",
466        '%meta%' => "meta-fuckin'",
467        '%hair%' => 'fro',
468        '%talk%' => 'rap',
469        '%music%' => 'beat',
470        '%basket%' => 'hoop',
471        '%football%' => 'ball',
472        '%friend%' => 'homey',
473        '%school%' => 'farm',
474        '%boss%' => 'Man',
475        '%want to%' => 'wanna',
476        '%wants to%' => "be hankerin' aftah",
477        '%well%' => 'sheeit',
478        '%Well%' => 'Sheeit',
479        '%big%' => 'big-ass',
480        '%bad%' => 'bad-ass',
481        '%small%' => 'little-ass',
482        '%sort of%' => 'radical',
483        '% is %' => ' be ',
484        '%water%' => 'booze',
485        '%book%' => "scribblin'",
486        '%magazine%' => 'issue of GQ',
487        '%paper%' => 'sheet',
488        '%\bup\b%' => 'down',
489        '%\bdown\b%' => 'waaay down',
490        '%break%' => 'boogie',
491        '%Hi%' => "'Sup, dude",
492        '%VAX%' => 'pink Cadillac',
493      );
494    
495      $search = array_keys($patterns);
496      $replace = array_values($patterns);
497      return preg_replace($search, $replace, $text);
498    }
499    
500    function _dialectic_avast($stub = '', $chance = 5) {
501      $shouts = array(
502        ", avast$stub",
503        "$stub Ahoy!",
504        ", and a bottle of rum!",
505        ", by Blackbeard's sword$stub",
506        ", by Davy Jones' locker$stub",
507        "$stub Walk the plank!",
508        "$stub Aarrr!",
509        "$stub Yaaarrrrr!",
510        ", pass the grog!",
511        ", and dinna spare the whip!",
512        ", with a chest full of booty$stub",
513        ", and a bucket o' chum$stub",
514        ", we'll keel-haul ye!",
515        "$stub Shiver me timbers!",
516        "$stub And hoist the mainsail!",
517        "$stub And swab the deck!",
518        ", ye scurvey dog$stub",
519        "$stub Fire the cannons!",
520        ", to be sure$stub",
521        ", I'll warrant ye$stub",
522      );
523    
524      shuffle($shouts);
525    
526      return (((1 == rand(1, $chance)) ? array_shift($shouts) : $stub) . ' ');
527    }
528    
529    function dialectic_upsidedown($text) {
530      $substitutions = array (
531        ' ' => ' ',
532        '!' => "¡",          # ¡
533        '"' => "„",          # „
534        '#' => '#',
535        '$' => '$',
536        '%' => '%',
537        '&' => "⅋",          # ⅋
538        "'" => "͵",          # ͵
539        '(' => ')',
540        ')' => '(',
541        '*' => '*',
542        '+' => '+',
543        ',' => "‘",          # ‘
544        '-' => '-',
545        '.' => "˙",          # ˙
546        '/' => '/',
547        '0' => '0',
548        '1' => "⃓",  # ,⃓ can be improved
549        '2' => "ჷ",          # ჷ
550        '3' => "ε",          # ε
551        '4' => "⇁⃓",  # ⇁⃓ can be improved
552        '5' => "ᔕ",          # ᔕ or maybe just "S"
553        '6' => '9',
554        '7' => "_̸",  # _̸
555        '8' => '8',
556        '9' => '6',
557        ':' => ':',
558        ';' => "⋅̕",  # ⋅̕ sloppy, should be improved
559        '<' => '>',
560        '=' => '=',
561        '>' => '<',
562        '?' => "¿",          # ¿
563        '@' => '@',                 # can be improved
564        'A' => "Ꮜ",          # Ꮜ
565        'B' => "ϴ",          # ϴ can be improved
566        'C' => "Ɔ",          # Ɔ
567        'D' => 'p',                 # should be an uppercase D!!
568        'E' => "Ǝ",          # Ǝ
569        'F' => "Ⅎ",          # Ⅎ
570        'G' => "⅁",          # ⅁
571        'H' => 'H',
572        'I' => 'I',
573        'J' => "ſ",  # ſ̲
574        'K' => "ʞ",          # ʞ should be an uppercase K!!
575        'L' => "⅂",          # ⅂
576        'M' => "Ɯ",          # Ɯ or maybe just "W"
577        'N' => 'N',
578        'O' => 'O',
579        'P' => 'd',                 # should be uppercase P
580        'Q' => "Ծ",          # Ծ can be improved
581        'R' => "Ȣ",          # Ȣ can be improved
582        'S' => 'S',
583        'T' => "⊥",          # ⊥
584        'U' => "ᑎ",          # ᑎ
585        'V' => "Λ",          # Λ
586        'W' => 'M',
587        'X' => 'X',
588        'Y' => "⅄",          # ⅄
589        'Z' => 'Z',
590        '[' => ']',
591        '\\' => '\\',
592        ']' => '[',
593        '^' => "‿",          # ‿
594        '_' => "‾",          # ‾
595        '`' => " ̖",  #  ̖
596        'a' => "ɐ",          # ɐ
597        'b' => 'q',
598        'c' => "ɔ",          # ɔ
599        'd' => 'p',
600        'e' => "ǝ",          # ǝ
601        'f' => "ɟ",          # ɟ
602        'g' => "ɓ",          # ɓ
603        'h' => "ɥ",          # ɥ
604        'i' => "ı̣",  # ı̣
605        'j' => "ſ",  # ſ̣
606        'k' => "ʞ",          # ʞ
607        'l' => "Ʈ",          # Ʈ can be improved
608        'm' => "ɯ",          # ɯ
609        'n' => 'u',
610        'o' => 'o',
611        'p' => 'd',
612        'q' => 'b',
613        'r' => "ɹ",          # ɹ
614        's' => 's',
615        't' => "ʇ",          # ʇ
616        'u' => 'n',
617        'v' => "ʌ",          # ʌ
618        'w' => "ʍ",          # ʍ
619        'x' => 'x',
620        'y' => "ʎ",          # ʎ
621        'z' => 'z',
622        '{' => '}',
623        '|' => '|',
624        '}' => '{',
625        '~' => "∼",          # ∼
626      );
627      $find = array_keys($substitutions);
628      $replace = array_values($substitutions);
629    
630      return str_replace($find, $replace, $text);
631    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2