public bool IsPassable(MeCabResult target) { return((!acceptFilter.Any() || acceptFilter.Where(f => f.品詞 == target.品詞 && (f.品詞細分類1 == target.品詞細分類1 || f.品詞細分類1 == null) && (f.品詞細分類2 == target.品詞細分類2 || f.品詞細分類2 == null) && (f.品詞細分類3 == target.品詞細分類2 || f.品詞細分類3 == null)).Any()) && !filter.Where(f => f.品詞 == target.品詞 && (f.品詞細分類1 == target.品詞細分類1 || f.品詞細分類1 == null) && (f.品詞細分類2 == target.品詞細分類2 || f.品詞細分類2 == null) && (f.品詞細分類3 == target.品詞細分類2 || f.品詞細分類3 == null)).Any()); }
private static Dictionary <string, MeCabResultAggregate> AddResult(this Dictionary <string, MeCabResultAggregate> result, MeCabResult add) { MeCabResultAggregate buf = new MeCabResultAggregate(); buf.Result = add; buf.Num = result.ContainsKey(add.表層形) ? result[add.表層形].Num + 1 : 1; result[add.表層形] = buf; return(result); }