public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables, ref IDocumentData[] documents, ProcessInfo processInfo) { string colName = param.GetStringParam("Name of new column").Value; int[] columns = param.GetMultiChoiceParam("Categories").Value; bool inverse = param.GetBoolParam("Inverse").Value; int[] catCols; int[] stringCols; Split(columns, out catCols, out stringCols, mdata.CategoryColumnCount); string[] word1 = param.GetMultiStringParam("Search terms").Value; if (word1.Length == 0){ processInfo.ErrString = "Please specify one or more search terms."; return; } if (string.IsNullOrEmpty(colName)){ colName = word1[0]; } string[] word = new string[word1.Length]; for (int i = 0; i < word.Length; i++){ word[i] = word1[i].ToLower().Trim(); } bool[] indicator = new bool[mdata.RowCount]; foreach (int col in catCols){ string[][] cat = mdata.GetCategoryColumnAt(col); for (int i = 0; i < cat.Length; i++){ foreach (string s in cat[i]){ foreach (string s1 in word){ if (s.ToLower().Contains(s1)){ indicator[i] = true; break; } } } } } foreach (string[] txt in stringCols.Select(col => mdata.StringColumns[col])){ for (int i = 0; i < txt.Length; i++){ string s = txt[i]; foreach (string s1 in word){ if (s.ToLower().Contains(s1)){ indicator[i] = true; break; } } } } string[][] newCol = new string[indicator.Length][]; for (int i = 0; i < newCol.Length; i++){ bool yes = inverse ? !indicator[i] : indicator[i]; newCol[i] = yes ? new[]{"+"} : new string[0]; } mdata.AddCategoryColumn(colName, "", newCol); }