public override int DocFreq(Term term) { int df; try { df = dfMap[term]; } catch (KeyNotFoundException) // C# equiv. of java code. { throw new System.ArgumentException("df for term " + term.Text + " not available"); } return df; }