public static TFIDFAnalyze LoadText(string fileName) { TFIDFAnalyze tfidf = new TFIDFAnalyze(); foreach (var item in System.IO.File.ReadLines(fileName)) { try { var d = item.Split('\t'); int c = int.Parse(d.Last()); tfidf.Add(d[0], d[1], c); } catch { } } return tfidf; }
public static TFIDFAnalyze LoadText(string fileName) { TFIDFAnalyze tfidf = new TFIDFAnalyze(); foreach (var item in System.IO.File.ReadLines(fileName)) { try { var d = item.Split('\t'); int c = int.Parse(d.Last()); tfidf.Add(d[0], d[1], c); } catch { } } return(tfidf); }
public static TFIDFAnalyze Marge(IEnumerable <string> fileNames) { TFIDFAnalyze analyze = new TFIDFAnalyze(); foreach (var fileName in fileNames) { foreach (var item in System.IO.File.ReadLines(fileName)) { try { var d = item.Split('\t'); int c = int.Parse(d.Last()); analyze.Add(d[0], d[1], c); } catch { } } } return(analyze); }
public static TFIDFAnalyze Marge(IEnumerable<string> fileNames) { TFIDFAnalyze analyze = new TFIDFAnalyze(); foreach (var fileName in fileNames) { foreach (var item in System.IO.File.ReadLines(fileName)) { try { var d = item.Split('\t'); int c = int.Parse(d.Last()); analyze.Add(d[0], d[1], c); } catch { } } } return analyze; }