SILUBS.ScriptureChecks.RepeatedWordsCheck.Check C# (CSharp) Method

Check() public method

Find all repeated words. Ignore any found in 'validItemsList'. Call RecordError delegate whenever any other repeated key is found.
public Check ( IEnumerable toks, RecordErrorHandler record ) : void
toks IEnumerable ITextToken's corresponding to the text to be checked. /// Typically this is one books worth.
record RecordErrorHandler Call this delegate to report each error found.
return void
		public void Check(IEnumerable<ITextToken> toks, RecordErrorHandler record)
		{
			// Find all repeated words. Put them in 'm_repeatedWords'.
			GetReferences(toks, string.Empty);

			string msg = Localize("Repeated word");

			foreach (TextTokenSubstring tts in m_repeatedWords)
			{
				if (!goodWords.Contains(tts.ToString()))
				{
					tts.Message = msg;
					record(new RecordErrorEventArgs(tts, CheckId));
				}
			}
		}