Accord.Fuzzy.Rule.GetRuleTokens C# (CSharp) Method

GetRuleTokens() private method

Performs a preprocessing on the rule, placing unary operators in proper position and breaking the string space separated tokens.
private GetRuleTokens ( string rule ) : string[]
rule string Rule in string format.
return string[]
        private string[] GetRuleTokens( string rule )
        {
            // breaking in tokens
            string[] tokens = rule.Split( ' ' );

            // looking for unary operators
            for ( int i = 0; i < tokens.Length; i++ )
            {
                // if its unary and there is an "IS" token before, we must change positions
                if ( ( unaryOperators.IndexOf( tokens[i].ToUpper( ) ) >= 0 ) &&
                     ( i > 1 ) && ( tokens[i - 1].ToUpper( ) == "IS" ) )
                {
                    // placing VAR name
                    tokens[i - 1] = tokens[i - 2];
                    tokens[i - 2] = tokens[i];
                    tokens[i] = "IS";
                }
            }

            return tokens;
        }