WARNING: Some of the code has changed from what I handed out on 2/20/95. In particular, some functions take slightly different arguments. Copy this directory (~kwc/suffix) to some place where you can write. cd to your copy run 'make' # create the suffix array # It is important to redirect the output to $1.suf $ sufsort1 data/genesis > data/genesis.suf # make a concordance of a phrase $ echo 'she conceived again' | suflookup data/genesis | pcontext -l15 -r40 data/genesis evi._29:35 And she conceived again, and bare a son: and me._29:33 And she conceived again, and bare a son; and eon._29:34 And she conceived again, and bare a son; and e Er._38:4 And she conceived again, and bare a son; and # suflookup takes an optional -c arg which allows you to print n # lines above and below the pattern of interest. echo 'Be fruitf' | suflookup -c1 data/genesis | pcontext -l0 data/genesis Bashemath the wife of Esau._36:11 And the sons of Be fruitful, and multiply, and fill the waters in Be fruitful, and multiply, and replenish the earth Be fruitful, and multiply, and replenish the earth Because I said, Lest I die for her._26:10 And Abim # compute the shared lengths $ sufshared data/genesis > data/genesis.shared # find strings of 50 or more characters that are repeated $ itoa < data/genesis.shared | awk '$1 > 50 {print $1 "\t" NR-1}' > /tmp/long # print out the first 10 strings with 50 or more characters that are repeated $ awk '{print $2}' /tmp/long | atoi | aref -s4 -a data/genesis.suf | \ pcontext -l0 -r50 data/genesis | head And she conceived again, and bare a son; and said And, behold, there came up out of the river seven Asenath the daughter of Potipherah priest of On b Be fruitful, and multiply, and replenish the eart Behold now, I have taken upon me to speak unto th I lifted up my voice and cried, that he left his Thou shalt not take a wife of the daughters of Ca Ye shall not see my face, except your brother [be after his kind: and God saw that [it was] good._1 after his kind: and God saw that [it was] good._1 # same as above, but prints out the frequency as well awk '{print $2}' /tmp/long | atoi | aref -s4 -a data/genesis.suf | \ pcontext -n '' -l0 -r50 data/genesis | suffreq -n '' data/genesis | head 2 And she conceived again, and bare a son; and said 2 And, behold, there came up out of the river seven 2 Asenath the daughter of Potipherah priest of On b 2 Be fruitful, and multiply, and replenish the eart 2 Behold now, I have taken upon me to speak unto th 2 I lifted up my voice and cried, that he left his 2 Thou shalt not take a wife of the daughters of Ca 2 Ye shall not see my face, except your brother [be 3 after his kind: and God saw that [it was] good.1 3 after his kind: and God saw that [it was] good.1