Find Minimal Pairs Easily with minimal_pairs.pl

The script minimal_pairs.pl will find every minimal pair for every contrast in a word list where each phoneme is represented by a single character. (This means that long vowels (e.g., aa) must be represented by a single character (e.g., A) for the program to find the contrast between them and their short counterparts (e.g., a).) It comes with two other files, Entry.pm and Parser.pm, which must be in the same directory for it to work. You can extract the file with the following commands:

gunzip min_pairs.tar.gz
tar xvf min_pairs.tar

This will create a new directory, called min_pairs. I recommend putting your data file in the same directroy and then going into that directory to run the script.

To see how it works, try running the script on a sample data file, like sample.txt, which should already be in the min_pairs directory:

cd min_pairs
perl ./min_pairs.pl sample.txt
If you're not sure how the script works, try running it without providing a filename as an argument, as follows:
% perl minimal_pairs.pl
Usage:
  [OPTIONS] minimal_pairs.pl 
Options:
  -c  Show contrasts
  -v  Verbose
The main thing to remember is that you can get two types of output:
  1. a list of minimal pairs for every word in the lexicon for which there are minimal pairs, OR
  2. a list of every contrast in the language, each with a list of the minimal pairs demonstrating the contrast
You get the latter when you use the -c option and the former when you don't, as follows:
% perl minimal_pairs.pl sample.txt

Ako = Ato
Ata = Ato
Ato = Ako, Ata

% perl minimal_pairs.pl -c sample.txt

/a/ vs. /o/
Ata / Ato

/k/ vs. /t/
Ako / Ato

/o/ vs. /a/
Ato / Ata

/t/ vs. /k/
Ato / Ako