/// <summary> /// Returns words matchin symset codes /// </summary> /// <param name="symsetCodes">The symset codes.</param> /// <param name="response">The response.</param> /// <returns></returns> public wordnetSymsetResults query_eng_symset(List <String> symsetCodes, ILogBuilder response) { wordnetSymsetResults output = new wordnetSymsetResults(); if (!isEngWordNetReady) { prepare_eng(response); } List <DataRow> matches = new List <DataRow>(); foreach (DataTable dt in wordnet_eng.Tables) { DataColumn cColumn = dt.Columns[1]; cColumn.ColumnName = "cCol"; foreach (String code in symsetCodes) { matches.AddRangeUnique(dt.Select(cColumn.ColumnName + " = '" + code + "'")); } } foreach (DataRow dr in matches) { DataColumn wColumn = dr.Table.Columns[0]; wColumn.ColumnName = "wCol"; DataColumn cColumn = dr.Table.Columns[1]; cColumn.ColumnName = "cCol"; String eng = dr[wColumn].toStringSafe(); String code = dr[cColumn].toStringSafe(); output.Add(code, eng); } if (response != null) { response.log("wordnet_eng_symset(" + symsetCodes.Join(',') + ") = rows[" + matches.Count + "] => words[" + output.GetEnglish().Count + "]"); } return(output); }
public wordnetSymsetResults query_srb_symset(List <String> symsetCodes, ILogBuilder response) { wordnetSymsetResults output = new wordnetSymsetResults(); getReady(); List <DataRow> matches = new List <DataRow>(); foreach (String code in symsetCodes) { matches.AddRangeUnique(table.Select(SRB_COLUMN_CODE + " = '" + code + "'")); } foreach (DataRow dr in matches) { String srb = dr[SRB_COLUMN_TOKEN].toStringSafe(); String code = dr[SRB_COLUMN_CODE].toStringSafe(); output.Add(code, srb); } if (response != null) { response.log("wordnet_srb_symset(" + symsetCodes.Join(',') + ") = rows[" + matches.Count + "] => words[" + output.GetEnglish().Count + "]"); } return(output); }