I wrote this PERL script in order to output minimal pairs from a document. To use this properly, you need to take a document and save it as text. Then you need to substitute items in the text so that each phoneme has a unique ASCII code. I highly recommend a key-item pair so you can convert the text back and forth as needed.
Then make sure that PERL is installed on your computer.
Then, from your command-line, go to the directory with both this .pl file AND your text file, and type in the relevant information in this format:
perl minimal_pair.pl {input.txt} {output.txt} {difference} {minimum size}
difference should be kept at 1 unless you want non-minimal pairs (not well tested)
Minimum size represent the minimum word size you wish to capture.
Output will have columns of the minimal pairs with the structure
minimal pair 1 | minimal pair 2 | phoneme 1 | phoneme 2