(* Trimming list of names *) maintainListTrim := Module[{totalcaption, time, names, n1, n2}, Print["----- Selecting names that are used in picture captions ..."]; totalcaption = (picCaptionW @@ #) & /@ picsTexas; totalcaption = Riffle[totalcaption, " "] // StringJoin; time = Timing[ names = StringCases[totalcaption, namesList, Overlaps -> All]; ][[1]]; n1 = Length[names]; names = Union[names]; n2 = Length[names]; Print["Completed in ", time, " second. Trimming names: ", Length[namesList], " -> ", n1, " -> ", n2]; namesList = names; namesList2 = Select[namesList, (Length[StringSplit[#]] === 2) &]; Print[Length[namesList], " names in total. ", Length[namesList2], " binary names in total."]; ];