public Hw2() { Documents = new List<Document>(); var d1 = new Document { D = "DataMining_uu_2012.hw2.D1.txt".ReadResource() }; var d2 = new Document { D = "DataMining_uu_2012.hw2.D2.txt".ReadResource() }; var d3 = new Document { D = "DataMining_uu_2012.hw2.D3.txt".ReadResource() }; var d4 = new Document { D = "DataMining_uu_2012.hw2.D4.txt".ReadResource() }; Documents.Add(d1); Documents.Add(d2); Documents.Add(d3); Documents.Add(d4); d1.UnigramsWords = CalculateUnigramsWords(d1.D); d1.BigramsWords = CalculateBigramsWords(d1.D); d1.TrigramsWords = CalculateTrigramsWords(d1.D); d1.BigramChars = CalculateBigramsChar(d1.D); d1.TrigramChars = CalculateTrigramsChar(d1.D); d2.UnigramsWords = CalculateUnigramsWords(d2.D); d2.BigramsWords = CalculateBigramsWords(d2.D); d2.TrigramsWords = CalculateTrigramsWords(d2.D); d2.BigramChars = CalculateBigramsChar(d2.D); d2.TrigramChars = CalculateTrigramsChar(d2.D); d3.UnigramsWords = CalculateUnigramsWords(d3.D); d3.BigramsWords = CalculateBigramsWords(d3.D); d3.TrigramsWords = CalculateTrigramsWords(d3.D); d3.BigramChars = CalculateBigramsChar(d3.D); d3.TrigramChars = CalculateTrigramsChar(d3.D); d4.UnigramsWords = CalculateUnigramsWords(d4.D); d4.BigramsWords = CalculateBigramsWords(d4.D); d4.TrigramsWords = CalculateTrigramsWords(d4.D); d4.BigramChars = CalculateBigramsChar(d4.D); d4.TrigramChars = CalculateTrigramsChar(d4.D); }
private static decimal TrigramMinHash(MultiplicativeHash mult, Document d1, Document d2, int hashFunctionCount) { return mult.TrigramCharMinHashing(d1.TrigramChars, d2.TrigramChars, hashFunctionCount); }