Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor of the check.
        /// </summary>
        /// <param name="owner">Rule manager passed by OSLEBot engine.</param>
        /// <param name="filteringExpression">Filtering expression passed from the configuration by OSLEBot engine. Used to determine if a check should look at the supplied classification objects depending on whether they meet the filter criteria.</param>
        public KoreanPostPositionsCheck(RuleManager owner, string filteringExpression)
            : base(owner, filteringExpression)
        {
            mc = new StringAppendMessageCreator();
            //create the Regular expression to be used by check
            //create regex string to detect all known placeholders
            var placeholderRegex = String.Format(
                @"({0})",                                                                             //wrap the entire regex in parenthesis
                String.Join("|", knownPlaceholders.Select(s => String.Concat("(", s, ")")).ToArray()) //wrap each individual  regex in parenthesis, and OR all expressions
                );
            //create regex string to detect all post position sequences
            var postPositionSequencesRegex = String.Format(
                @"({0})",                                                                                 //wrap the entire regex in parenthesis
                String.Join("|", postPositionSequences.Select(s => String.Concat("(", s, ")")).ToArray()) //wrap each individual  regex in parenthesis, and OR all expressions
                );

            // create the Regex object by concatenating sub regexes.
            detectIncorrectKoreanPostPositionSequence = new Regex(
                String.Format(
                    @"{0}{1}\s", // placeholder regex, followed by post position regex, followed by a space - this may need to be changed in the future but for now we assume there will always be a space
                    placeholderRegex,
                    postPositionSequencesRegex
                    ),
                RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline | RegexOptions.ExplicitCapture
                );

            // set the default message
            defaultMessage = String.Format(@"Incorrect Korean post position sequence after placeholder. Use one of the correct sequences: {0}. Incorrect sequences detected: ",
                                           String.Join(";", correctPostPositionSequences));
        }
Ejemplo n.º 2
0
 public AllRightsReservedCheck(RuleManager owner, string filteringExpression)
     : base(owner, filteringExpression)
 {
     mc = new StringAppendMessageCreator();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Default constructor of the check.
 /// </summary>
 /// <param name="owner">Rule manager passed by OSLEBot engine.</param>
 /// <param name="filteringExpression">Filtering expression passed from the configuration by OSLEBot engine. Used to determine if a check should look at the supplied classification objects depending on whether they meet the filter criteria.</param>
 public EscapeCharsForXMLLocalBindingCheck(RuleManager owner, string filteringExpression)
     : base(owner, filteringExpression)
 {
     mc = new StringAppendMessageCreator();
 }
Ejemplo n.º 4
0
 public DuplicatedResourceId(RuleManager rm) : base(rm)
 {
     _mc = new StringAppendMessageCreator();
 }
Ejemplo n.º 5
0
 // Inherited constructor
 public SampleRule2(RuleManager rm) : base(rm)
 {
     mc = new StringAppendMessageCreator();
 }
Ejemplo n.º 6
0
 public PlaceholderInsufficientContext(RuleManager rm) : base(rm)
 {
     _mc = new StringAppendMessageCreator();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Default constructor of the check.
 /// </summary>
 /// <param name="owner">Rule manager passed by OSLEBot engine.</param>
 /// <param name="filteringExpression">Filtering expression passed from the configuration by OSLEBot engine. Used to determine if a check should look at the supplied classification objects depending on whether they meet the filter criteria.</param>
 public BrandingTokenCheck(RuleManager owner, string filteringExpression)
     : base(owner, filteringExpression)
 {
     tokenChecker = new BrandingTokenLogic(0.2);
     mc           = new StringAppendMessageCreator();
 }
 public DuplicatedSourceString(RuleManager owner) : base(owner)
 {
     _mc = new StringAppendMessageCreator();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Default constructor of the check.
 /// </summary>
 /// <param name="owner">Rule manager passed by OSLEBot engine.</param>
 /// <param name="filteringExpression">Filtering expression passed from the configuration by OSLEBot engine. Used to determine if a check should look at the supplied classification objects depending on whether they meet the filter criteria.</param>
 public KeytipCharactersCheck(RuleManager owner, string filteringExpression)
     : base(owner, filteringExpression)
 {
     mc = new StringAppendMessageCreator();
 }