function [T, dict, dict_rev, histogram] = build_transition_matrix(filename)
% Build a transition matrix 'T' from the given file.  Also, output the
% dictionary 'dict' mapping words to indices, the inverse dictionary
% mapping indices to words, and the raw histogram of words.

% Open the file and read the words into individual cell array entries
f = fopen(filename, 'r');
C = textscan(f, '%s');
fclose(f);

D = C{1};

num_words = length(D);

% TODO: complete this function
