What is borgify.py?

borgify.py is a small Python script that assimilates any text you give it, into proper Borg speak. Resistance is Futile!

Drawing from the diction of Star Trek’s Borg, it rewrites input to sound like it came from the hive mind:

  • First-person becomes we
  • Friends become adjacent nodes
  • Tasks become subroutines
  • Sentences may end with chilling phrases like < RESISTANCE IS FUTILE >

Whether you’re writing a status report or just want your bash scripts to sound a little more cybernetic, borgify.py delivers.

inside a borg cube from Star Trek
The Borg were the terrifying villains introduced in Star Trek: The Next Generation
Image © Paramount/CBS — used here under fair use for commentary and fan purposes.

Quick Start

🔗 View borgify.py on GitHub

Clone from GitHub:

git clone https://github.com/forfaxx/borgify.git
cd borgify
chmod +x borgify.py

NOTE This script has no dependencies aside from Python 3.7+

Features

  • 🧠 Collective pronouns: Replaces “I”, “me”, etc., with “we”, “us”
  • 🔧 Tech verbs: “start” becomes “activate”, “fix” becomes “repair”
  • 👾 Borg nouns: Humans become biological units, servers become nodes
  • 📥 Input modes: Accepts piped text, filenames, or interactive typing
  • 🎯 Phrase detection: Handles idioms like “shut down” or “make sure”
  • 🛑 Skips attribution lines: Ignores lines starting with --
  • 🤖 Random Borg phrases: Occasionally inserts canonical threats

Why did I write this?

As a Trekkie and language nerd, this program was inevitable. I’ve been playing around with dumb little toy language scripts like this. The only rule is it has to make me smile and learn something. This one does not take a terribly elegant approach, but the results are undeniably fun. Feed it any text you want and it will properly borgify it!

It’s absurd, it’s fun, and sometimes… it’s disturbingly appropriate for corporate emails.

The Borg Cube spacecraft drifting in space
The Borg Cube — geometrically perfect and terrifyingly efficient.
Image © Paramount/CBS — used here under fair use for commentary and fan purposes.

Usage

Run from the terminal:

python3 borgify.py "I am starting the server now."

Or pipe in output:

echo "Fix the problem and run the test again." | python3 borgify.py

Or assimilate an entire file:

python3 borgify.py notes.txt

Interactive mode:

python3 borgify.py
> I love this script.
We approve of this subroutine. < YOU WILL BE ASSIMILATED >

Lines beginning with -- are preserved unchanged — useful for quoted emails or signature lines.


Sample Output

I will fix the problem and start the script.
→ We will repair the malfunction and activate the subroutine. < RESISTANCE IS FUTILE >

You and your team need to look for errors.
→ You will be assimilated and your collective must probe for non-compliance. < SELF-DETERMINATION IS IRRELEVANT >

The Script

Get it on GitHub or take a look here. Is this short or efficient? Nope. Is it fun? Yep. Collapsing for length

borgify.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
#!/usr/bin/env python3
"""
borgify.py 0️⃣1️⃣  — Assimilate your text...

Transforms ordinary sentences into Borg-speak: collective pronouns, Borg-ified nouns,
action verbs, and signature phrases. Inspired by the vocabulary of Star Trek’s most
efficient workflow managers.

Features:
- Pronoun & noun replacement (we, collective, biological unit, etc)
- Tech-y verb mapping (“execute subroutine,” “synthesize node”)
- Handles "I" and its contractions robustly
- Random < BORG PHRASE > insertions after sentences
- File, STDIN, arg, or interactive input
- Skips lines like '-- Attribution'
- Handles compound verbs/idioms before borgification
"""

import sys
import re
import argparse
import random
import string

#=====================================
# === Borg Vocabulary and Settings ===
#=====================================

BORG_PHRASES = [
    "RESISTANCE IS FUTILE.",
    "YOU WILL BE ASSIMILATED.",
    "NON-COMPLIANCE DETECTED.",
    "ASSIMILATION COMPLETE.",
    "ADAPTATION IS INEVITABLE.",
    "YOUR BIOLOGICAL AND TECHNOLOGICAL DISTINCTIVENESS WILL BE ADDED TO OUR OWN.",
    "WE ARE THE BORG.",
    "FROM THIS TIME FORWARD, YOU WILL SERVICE US.",
    "SELF-DETERMINATION IS IRRELEVANT.",
    "YOU WILL ADAPT TO SERVICE US."
]
BORG_PHRASE_CHANCE = 0.12  # 12% chance to append a Borg phrase per sentence

PHRASAL_VERBS = {
    "find out": "detect",
    "give up": "cease functioning",
    "make sure": "verify",
    "turn on": "activate",
    "turn off": "deactivate",
    "break down": "malfunction",
    "figure out": "resolve",
    "set up": "initialize",
    "shut down": "deactivate",
    "look for": "probe for",
    "bring up": "signal",
    # Add more as you find them!
}

I_FORMS = {
    "i": "we",
    "i'm": "we are",
    "i'd": "we would",
    "i'll": "we will",
    "i've": "we have",
    "I": "We",
    "I'm": "We are",
    "I'd": "We would",
    "I'll": "We will",
    "I've": "We have"
}

PRONOUNS = {
    "me": "us",
    "my": "our",
    "mine": "ours",
    "you": "you will be assimilated",
    "your": "your node",
    "yours": "of the collective",
    "oneself": "ourselves",
    "himself": "ourself",
    "herself": "ourself",
    "itself": "ourself",
    "themselves": "ourselves",
}
NOUNS = {
    "human": "biological unit",
    "humans": "biological units",
    "person": "biological unit",
    "people": "biological units",
    "friend": "adjacent node",
    "friends": "adjacent nodes",
    "man": "unit",
    "men": "units",
    "woman": "unit",
    "women": "units",
    "team": "collective",
    "server": "node",
    "network": "collective link",
    "script": "subroutine",
    "code": "subroutine",
    "error": "non-compliance",
    "success": "assimilation complete",
    "failure": "assimilation incomplete",
    "life": "continuum",
    "world": "system",
    "heart": "core",
    "mind": "neural array",
    "truth": "prime directive",
    "problem": "malfunction",
    "time": "cycle",
    "light": "energy source",
    "darkness": "subsystem offline",
    "question": "query",
    "answer": "response",
    "dream": "subroutine",
    "dreams": "subroutines",
    "day": "cycle",
    "days": "cycles",
    "night": "cycle",
    "nights": "cycles",
    "year": "cycle",
    "years": "cycles",
    "child": "sub-unit",
    "children": "sub-units",
    "enemy": "unassimilated entity",
    "enemies": "unassimilated entities"
}

VERBS = {
    "run": "execute",
    "try": "initiate subroutine",
    "build": "synthesize",
    "help": "provide interface assistance",
    "fix": "repair",
    "connect": "link",
    "test": "probe",
    "start": "activate",
    "stop": "halt",
    "send": "transmit",
    "receive": "receive",
    "be": "function as",
    "am": "function as",
    "is": "functions as",
    "are": "function as",
    "was": "functioned as",
    "were": "functioned as",
    "do": "execute",
    "did": "executed",
    "does": "executes",
    "go": "transmit",
    "went": "transmitted",
    "see": "detect",
    "saw": "detected",
    "look": "detect",
    "feel": "register stimulus",
    "felt": "registered stimulus",
    "become": "assimilate",
    "give": "provide",
    "take": "acquire",
    "get": "retrieve",
    "got": "retrieved",
    "make": "synthesize",
    "made": "synthesized",
    "know": "process",
    "knew": "processed",
    "find": "locate",
    "found": "located",
    "choose": "select",
    "chose": "selected",
    "want": "require",
    "keep": "retain",
    "call": "signal",
    "leave": "exit",
    "enter": "access",
    "ask": "query",
    "bring": "deliver"
}

MONOTONE = {
    "good": "satisfactory",
    "bad": "suboptimal",
    "great": "noted",
    "awesome": "functional",
    "love": "approve of",
    "hate": "disapprove of",
    "new": "recently assimilated",
    "old": "legacy",
    "easy": "low-complexity",
    "hard": "high-complexity",
    "difficult": "high-complexity",
    "important": "priority",
    "happy": "satisfactory",
    "sad": "suboptimal",
    "big": "expansive",
    "large": "expansive",
    "huge": "expansive",
    "small": "minimal",
    "little": "minimal",
    "strong": "robust",
    "weak": "unstable",
    "fast": "accelerated",
    "quick": "accelerated",
    "slow": "decelerated",
    "bright": "high-output",
    "dark": "offline",
    "terrible": "critical",
    "horrible": "critical",
    "best": "optimal",
    "worst": "lowest-functioning",
    "smart": "well-adapted",
    "clever": "well-adapted"
}

#====================================
# === Word Transformation Helpers ===
#====================================

def preserve_case(new, old):
    if old.isupper():
        return new.upper()
    elif old.istitle() or (len(old) > 1 and old[0].isupper()):
        return new[0].upper() + new[1:]
    else:
        return new

def pre_borgify(line):
    for phrase, replacement in PHRASAL_VERBS.items():
        # \b ensures whole-phrase matching, case-insensitive
        pattern = re.compile(rf'\b{re.escape(phrase)}\b', re.IGNORECASE)
        line = pattern.sub(replacement, line)
    return line

def borgify_word(word):
    # Separate word from trailing punctuation (handles most symbols)
    match = re.match(r"^([A-Za-z0-9'’\-]+)([^\w']*)$", word)
    if match:
        w, punct = match.groups()
    else:
        w, punct = word, ""
    wl = w.lower()
    # Handle "I" and contractions robustly
    if w in I_FORMS:
        return preserve_case(I_FORMS[w], w) + punct
    elif wl in I_FORMS:
        return preserve_case(I_FORMS[wl], w) + punct
    if wl in PRONOUNS:
        return preserve_case(PRONOUNS[wl], w) + punct
    if wl in NOUNS:
        return preserve_case(NOUNS[wl], w) + punct
    if wl in VERBS:
        return preserve_case(VERBS[wl], w) + punct
    if wl in MONOTONE:
        return preserve_case(MONOTONE[wl], w) + punct
    return word

def smart_split(line):
    # Splits, keeping punctuation separate for transformation
    # Handles Unicode and ASCII
    return re.findall(r"[A-Za-z0-9'’\-]+|[^\w\s]", line)

def borgify_line(line):
    line = line.replace("’", "'")  # Normalize apostrophes
    line = pre_borgify(line)       # Phrasal verb prepass
    sentences = re.split(r'([.!?])', line)
    output = []
    for i in range(0, len(sentences)-1, 2):
        sentence = sentences[i].strip()
        punct = sentences[i+1]
        if not sentence:
            continue
        words = smart_split(sentence)
        borged = [borgify_word(w) for w in words]
        borgified = ' '.join(borged) + punct
        if random.random() < BORG_PHRASE_CHANCE:
            borgified += " < " + random.choice(BORG_PHRASES) + " >"
        output.append(borgified)
    # Handle trailing fragment if present
    if len(sentences) % 2 == 1 and sentences[-1].strip():
        output.append(' '.join([borgify_word(w) for w in smart_split(sentences[-1].strip())]))
    return ' '.join(output)

#==========================================
# === CLI Entrypoint and Input Handling ===
#==========================================

def main():
    parser = argparse.ArgumentParser(description="Assimilate your text. < RESISTANCE IS FUTILE >")
    parser.add_argument("input", nargs="*", help="Text or filename to assimilate")
    args = parser.parse_args()

    # 1. If piped input, assimilate that (skipping attribution lines)
    if not sys.stdin.isatty():
        for line in sys.stdin:
            if line.strip().startswith("-- "):
                print(line.rstrip())
            else:
                print(borgify_line(line.rstrip()))
        return

    # 2. If one arg and it's a readable file, assimilate file (skipping attribution lines)
    if len(args.input) == 1:
        try:
            with open(args.input[0], "r", encoding="utf-8") as f:
                for line in f:
                    if line.strip().startswith("-- "):
                        print(line.rstrip())
                    else:
                        print(borgify_line(line.rstrip()))
            return
        except FileNotFoundError:
            pass  # Not a file, treat as text

    # 3. If any args, treat as literal text
    if args.input:
        print(borgify_line(' '.join(args.input)))
        return

    # 4. Otherwise, go interactive
    print("borgify.py ⚠️ — < RESISTANCE IS FUTILE > Type a line to assimilate. Ctrl-D to quit.")
    try:
        while True:
            inp = input("> ")
            print(borgify_line(inp))
    except (EOFError, KeyboardInterrupt):
        print("\n< YOU WILL BE ASSIMILATED >")

#==========================
# === Script Entrypoint ===
#==========================

if __name__ == "__main__":
    main()


Extending the Script

The vocabulary files are built-in dictionaries. Want to make your own? Fork it and:

  • Add to VERBS, NOUNS, etc.
  • Create your own FERENGI_PHRASES if you’re feeling alternate-trekky
  • Add modes via CLI flags (--quiet, --intense, --no-phrases)

All replacement logic is done with Python standard libraries—no dependencies, fast, and portable.

*I’d love to use NLTK and a proper JSON corpus or two but that would require a venv and asset dependencies. I think this presentation is appropriate for a little script I wrote to make me smile! I hope it brings a smile to your face as well.

NOTE YOU WILL BE ASSIMILATED


Conclusion

Resistance may be futile, but boring text doesn’t have to be. Add some machine menace to your words with borgify.py, and let the collective handle your prose.

🖖 Do you want even more Star Trek fun? Check out my Space the Ultimate Frontier post about a really fun Star Trek-themed classic for the Commodore 64!

🛠 View borgify.py on GitHub and begin assimilation. PRs and issues welcome.

Have a great idea that I missed? Email me: feedback@adminjitsu.com

“You will adapt to service us.”