Changeset 15901


Ignore:
Timestamp:
04/13/18 11:11:51 (18 months ago)
Author:
fbaching
Message:

#2911: change to lowercase string identifier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2911_TSQLSymbolicExpressionFormatter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/TSQLExpressionFormatter.cs

    r15900 r15901  
    9393      //Generate function header
    9494      strBuilder.Append("CREATE FUNCTION dbo.REGRESSIONMODEL(");
    95       strBuilder.Append(string.Join(", ", sortedVarcharIdentifiers.Select(n => String.Format("{0} NVARCHAR(max)",n))));
     95      strBuilder.Append(string.Join(", ", sortedVarcharIdentifiers.Select(n => string.Format("{0} NVARCHAR(max)",n))));
    9696      if (varcharVarNames.Any() && floatVarNames.Any())
    9797        strBuilder.Append(",");
    98       strBuilder.Append(string.Join(", ", sortedFloatIdentifiers.Select(n => String.Format("{0} FLOAT",n))));
     98      strBuilder.Append(string.Join(", ", sortedFloatIdentifiers.Select(n => string.Format("{0} FLOAT",n))));
    9999      strBuilder.AppendLine(")");
    100100
     
    106106      strBuilder.AppendLineIndented(1, "-- added variable declaration for convenience");
    107107      foreach (var name in sortedVarcharIdentifiers)
    108         strBuilder.AppendLineIndented(1, String.Format("-- DECLARE {0} NVARCHAR(max) = ''", name));
     108        strBuilder.AppendLineIndented(1, string.Format("-- DECLARE {0} NVARCHAR(max) = ''", name));
    109109      foreach (var name in sortedFloatIdentifiers)
    110         strBuilder.AppendLineIndented(1, String.Format("-- DECLARE {0} FLOAT = 0.0", name));
     110        strBuilder.AppendLineIndented(1, string.Format("-- DECLARE {0} FLOAT = 0.0", name));
    111111      strBuilder.AppendLineIndented(1, "-- SELECT");
    112112      strBuilder.AppendLine("RETURN ");
     
    142142          FormatOperator(level, node, "OR", strBuilder);
    143143        } else if (node.Symbol is Xor) {
    144           throw new NotSupportedException(String.Format("Symbol {0} not yet supported.", node.Symbol.GetType().Name));
     144          throw new NotSupportedException(string.Format("Symbol {0} not yet supported.", node.Symbol.GetType().Name));
    145145        } else if (node.Symbol is Sine) {
    146146          FormatFunction(level, node, "SIN", strBuilder);
     
    172172        } else if (node.Symbol is BinaryFactorVariable) {
    173173          var binFactorNode = node as BinaryFactorVariableTreeNode;
    174           throw new NotSupportedException(String.Format("Symbol {0} not yet supported.", node.Symbol.GetType().Name));
     174          throw new NotSupportedException(string.Format("Symbol {0} not yet supported.", node.Symbol.GetType().Name));
    175175        } else {
    176176          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for TSQL symbolic expression tree formatter.");
     
    267267    private void FormatFactor(int level, FactorVariableTreeNode node, StringBuilder strBuilder) {
    268268      strBuilder.AppendLine("( ");
    269       strBuilder.AppendLineIndented(level + 1, String.Format("CASE {0}", VariableName2Identifier(node.VariableName)));
     269      strBuilder.AppendLineIndented(level + 1, string.Format("CASE {0}", VariableName2Identifier(node.VariableName)));
    270270      foreach (var name in node.Symbol.GetVariableValues(node.VariableName)) {
    271         strBuilder.AppendLineIndented(level + 2, String.Format("WHEN '{0}' THEN {1}", name, node.GetValue(name).ToString(CultureInfo.InvariantCulture)));
     271        strBuilder.AppendLineIndented(level + 2, string.Format("WHEN '{0}' THEN {1}", name, node.GetValue(name).ToString(CultureInfo.InvariantCulture)));
    272272      }
    273273      strBuilder.AppendLineIndented(level + 1, "ELSE NULL END");
Note: See TracChangeset for help on using the changeset viewer.