text: public static void Main(string[] args){string field = null;int numTerms = DEFAULT_NUMTERMS;if (args.Length == 0 || args.Length > 4){throw new ArgumentException();}Store.Directory dir = FSDirectory.Open(new DirectoryInfo(args[0]));IComparer<TermStats> comparer = new DocFreqComparer();for (int i = 1; i < args.Length; i++){if (args[i].Equals("-t", StringComparison.Ordinal)){comparer = new TotalTermFreqComparer();}else{if (!int.TryParse(args[i], NumberStyles.Integer, CultureInfo.InvariantCulture, out numTerms))field = args[i];}}using (IndexReader reader = DirectoryReader.Open(dir)){TermStats[] terms = GetHighFreqTerms(reader, numTerms, field, comparer);for (int i = 0; i < terms.Length; i++){Console.WriteLine("{0}:{1} \t totalTF = {2:#,##0} \t doc freq = {3:#,##0} \n", terms[i].Field, terms[i].GetTermText(), terms[i].TotalTermFreq, terms[i].DocFreq);}}}