public StopSignConfiguration CreateSignConfiguration() { StopSignConfiguration configuation = new StopSignConfiguration(); configuation.Sign = Sign; configuation.Exceptions = GetExceptions(); return(configuation); }
/// <summary> /// Find out if a word is an exception, and therefore does not complete a sentence /// </summary> /// <param name="processContext">A processing context which lives until the process is finished, /// and stores data for the process</param> /// <returns></returns> private bool IsExceptionalWord(AnalysisProcessContext processContext) { var sign = processContext.Sign; var stopSignConfigurations = processContext.AnalysisConfiguration.StopSignConfigurations; StopSignConfiguration stopSignConfiguration = null; bool isExceptionalWord = false; if (stopSignConfigurations.TryGetValue(processContext.Sign, out stopSignConfiguration)) { processContext.StopSignConfiguration = stopSignConfiguration; //Find out if a word is an exception, by exception which correspond to the location of the word isExceptionalWord = IsAnyExceptionMatch(processContext, processContext.WordLocation); if (!isExceptionalWord) { //Find out if a word is an exception, by general exceptions isExceptionalWord = IsAnyExceptionMatch(processContext, WordLocation.Anywhere); } } return(isExceptionalWord); }