Also close bug
[filters.git] / chef
CommitLineData
7e3afbba 1#!/usr/bin/perl -p
2# Swedish Chef filter. Bork Bork Bork!
3# Copyright 1999 by Joey Hess under the terms of the GNU GPL.
4
5# Note that the order of the commands in this program is very important!
6
7# Change 'e' at the end of a word to 'e-a', but don't mess with the word
8# "the".
9s{(\w+)e(\b)}{
10 if (lc($1) ne 'th') {
11 "$1e-a$2"
12 }
13 else {
14 "$1e$2"
15 }
16}eg;
17
18# Stuff that happens at the end of a word.
19s/en(\b)/ee$1/g;
20s/th(\b)/t$1/g;
21
22# Stuff that happens if not the first letter of a word.
23s/(\w)f/$1ff/g;
24
25# Change 'o' to 'u' and at the same time, change 'u' to 'oo'. But only
26# if it's not the first letter of the word.
27tr/ou/uo/;
28s{(\b)([uo])}{
29 $1 . $2 eq 'o' ? 'u' : 'o'
30}eg;
31# Note that this also handles doubling "oo" at the beginning of words.
32s/o/oo/g;
33# Have to double "Oo" seperatly.
34s/(\b)O(\w)/$1Oo$2/g;
35# Fix the word "bork", which will have been mangled to "burk"
7caa7795 36# by above commands. Note that any occurrence of "burk" in the input
7e3afbba 37# gets changed to "boork", so it's completly safe to do this:
cd3ff89e 38s/\b([Bb])urk\b/$1ork/g;
7e3afbba 39
40# Stuff to do to letters that are the first letter of any word.
41s/\be/i/g;
42s/\bE/I/g;
43
44# Stuff that always happens.
cd3ff89e 45s/tiun/shun/g; # this actually has the effect of changing "tion" to "shun".
7e3afbba 46s/the/zee/g;
47s/The/Zee/g;
48tr/vVwW/fFvV/;
49
50# Stuff to do to letters that are not the last letter of a word.
51s/a(?!\b)/e/g;
52s/A(?!\b)/E/g;
53
54s/en/un/g; # this actually has the effect of changing "an" to "un".
55s/En/Un/g; # this actually has the effect of changing "An" to "Un".
56s/eoo/oo/g; # this actually has the effect of changing "au" to "oo".
57s/Eoo/Oo/g; # this actually has the effect of changing "Au" to "Oo".
58
cd3ff89e 59# Change "ow" to "oo".
60s/uv/oo/g;
7e3afbba 61
62# Change 'i' to 'ee', but not at the beginning of a word,
63# and only affect the first 'i' in each word.
64s/(\b\w[a-hj-zA-HJ-Z]*)i/$1ee/g;
65
66# Special punctuation of the end of sentances but only at end of lines.
67s/([.?!])$/$1\nBork Bork Bork!/g;
This page took 0.012024 seconds and 4 git commands to generate.